You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Could pass along something like "Pill.go:42" to stringer.
Alternately, or in addition to, one could imagine //go:generate supporting a mode where it must be defined right before a type, variable or function, such that it could pass along that information to the tool.
The text was updated successfully, but these errors were encountered:
adg
changed the title
Ability for //go:generate commands to pass context to invoked tool
cmd/go: //go:generate directives to pass context to invoked tool
Feb 22, 2015
rsc
changed the title
cmd/go: //go:generate directives to pass context to invoked tool
cmd/go: pass line number of generate directive in environment
Apr 10, 2015
@rsc Ah, I had missed the $GOFILE environment variable. That's obviously cleaner than having command line arguments to go generate. Adding a $GOLINE to pair with it would be perfect.
It would be very useful if the go:generate command gained the ability to pass along file and line to the invoked tool, to avoid redundant definitions.
For example:
Could pass along something like "Pill.go:42" to stringer.
Alternately, or in addition to, one could imagine //go:generate supporting a mode where it must be defined right before a type, variable or function, such that it could pass along that information to the tool.
The text was updated successfully, but these errors were encountered: