Can 'go build' and 'go test' use default tags?

Specifically, I use the magic package, and the functions I use dictate that I always need to build it with the "gm" build tag. Is there a way to declare a default build tag so that 'go build' for my project (or 'go test') will implicitly build magic with 'gm'?

+3


source to share


1 answer


No, they can't. You either need to type them on the cmd line or use a makefile.



+2


source







All Articles