3 ms·
He lost me very early: "Opening bracket must be placed at the end of the line in Go. Interestingly this is not enforced by gofmt," Eh, no, of course it's
by gizzlon 6y ago
He lost me very early:
"Opening bracket must be placed at the end of the line in Go. Interestingly this is not enforced by gofmt,"
Eh, no, of course it's not. It's a syntax error, fixing those are NOT the point of go fmt
- dvh 6y agoIf only you would read 5 more lines you would notice author says it is syntax error.
- oefrha 6y agoYes, the fact that the author knows it’s a syntax error yet still made that bizarre comment about gofmt not enforcing the style indicates that he doesn’t realize gofmt is not for fixing syntax errors (in fact, it refuses to format anything when there’s a syntax error and simply errors out, so my guess is the author only used gofmt as a formatting action in an editor like VS Code, and assumed no code change on shift+option+f means gofmt doesn’t enforce it). And that’s exactly what gp’s complaining about — demonstrated lack of understanding of gofmt.
- josefx 6y agoI think that it is a syntax error is the weird part, in most languages it wouldn't be. So people stumble over an error that normally is considered a style choice.