github.com/graybobo/golang.org-package-offline-cache@v0.0.0-20200626051047-6608995c132f/x/talks/2014/hammers/format.go (about) 1 // +build ignore 2 3 package main 4 5 import ( 6 "fmt" 7 "go/format" 8 ) 9 10 func main() { 11 ugly := `func (f *File) Read(p []byte, )(n int, err error, ){}` 12 fmt.Println(ugly) 13 pretty, _ := format.Source([]byte(ugly)) // HL 14 fmt.Println(string(pretty)) 15 }