4 ms·
One of the really great things about go generate is that the command to run (and thus the reminder that you need to run it) can and should exist very near to th
by NateDad 12y ago
One of the really great things about go generate is that the command to run (and thus the reminder that you need to run it) can and should exist very near to the code that might change. If you see
//go:generate stringer -type Pill
const (
Placebo Pill = iota
Aspirin
)
Then you'll probably remember when you add an item to the list that you need to rerun go generate.
- waps 12y agoAnd if you don't have the dependencies this requires ? Given this design, why would the library author even specify/include the tool required ? Or worse: what if there's a tool called "stringer" on your device that isn't what is on the developer's machine ? Even worse : what if it's subtly different ?
- NateDad 12y agoHow is that different than any other way to run external tools? Make or Python or anything else has the exact same problem.