3 ms·
As far as I understand go fmt works on the AST, if your reformatter doesn't work on the AST then you will eventually have problems. Also go fmt doesn't ever ch
by placeybordeaux 12y ago
As far as I understand go fmt works on the AST, if your reformatter doesn't work on the AST then you will eventually have problems.
Also go fmt doesn't ever change your code, thats what go fix is for.
- moonlighter 12y agogofmt -r applies rewrite rules, and -s also performs source transformations; both change the code.
- NateDad 12y agogofmt without flags does not change your code. Yes, you can ask it to change your code if you want it to, but by default, it won't.
- masklinn 12y ago> As far as I understand go fmt works on the AST, if your reformatter doesn't work on the AST then you will eventually have problems. JsFmt also works on the AST. Working on the AST does not mean your rewrite rules can be bulletproof, let alone are.
- nilkn 12y agoFrom the readme: > Javascript formatters exist but most (all?) work on just strings, not the AST. Using Esprima under the hood we have access to the full AST and can do useful things like intelligent find and replace as in gofmt.