3 ms·
There's a parser in the standard library that makes parsing Go code simple (regardless of format). This is actually what gofmt uses, I believe.
by NateDad 14y ago
There's a parser in the standard library that makes parsing Go code simple (regardless of format). This is actually what gofmt uses, I believe.
- 4ad 14y agoYou are correct. I'll also add that consistent formatting provides an excellent aid for grepping. Sometimes you want to search for code in the standard library that does something similar to what you do, or you are looking for a specific idiom. Consistent formatting helps making a simple regular expression pretty exhaustive. Combined with structural regular expressions you can answer questions like "what are the types that contain both a mutex and a map, and what are the types that contain the types that use a map without a mutex": http://pastebin.ca/2202690 http://pastebin.ca/2202690