Skip to content

Instantly share code, notes, and snippets.

@oconnor663
Created May 22, 2015 17:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oconnor663/b7987d336d99d6a17dfe to your computer and use it in GitHub Desktop.
Save oconnor663/b7987d336d99d6a17dfe to your computer and use it in GitHub Desktop.
Go's weird treatment of newlines
package main
import "fmt"
type Foo struct {
Bar int
}
func main() {
var myfoo Foo
// Fine.
myfoo = Foo{5}
// Also fine.
myfoo = Foo{
5,
}
// Breaks the build and gofmt.
myfoo = Foo{
5
}
fmt.Println("%#v", myfoo)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment