News for hackers. Stuff that matters.
Re:Just tell me how to use Go Modules by Zach_the_Lizard on Tuesday December 11, 2018 @09:31AM (#18655484)
I second the comments about the various AST and type packages. They are just absurdly unfriendly.

I've written a linter / code formatter / auto bug repair tool internally for my current company and it sucked. Still sucks. Comments doubly so.

The examples are few, undocumented, and don't always work with the vendor directory concept.

I had to write my own custom importer to get vendor support to be more reliable.

I like the concept of shipping with an AST package; it's very forward looking and useful.

I too hope the go/analysis package could be the answer. I believe it has not merged but has a prototype version that conflicts with master. Maybe they'll patch it up and get it landed soon. I hope, anyways

Re:Just tell me how to use Go Modules by Groxx on Tuesday December 11, 2018 @04:44PM (#18659208)
AST for read access I find relatively decent. Straightforward and not complicated.

For manipulating code tho (e.g. for code gen or rewriting), yeah - absurdly unfriendly fits pretty well, and comments only kinda sorta mostly work until you actually try to produce anything polished. It kinda feels like they prioritized forward-compatibility at the cost of usability (which could be a decent decision / a fair tradeoff, but it sucks as a user trying to do stuff now).