Skip to content

Instantly share code, notes, and snippets.

@oconnor663
Created May 22, 2015 17:30
Show Gist options
  • Select an option

  • Save oconnor663/b7987d336d99d6a17dfe to your computer and use it in GitHub Desktop.

Select an option

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)
}
@doodlemania2

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment