Closed gudvinr closed 5 years ago
Thanks for reporting. I will try to get some time to rewrite some parts of enumer, fixing these incompatibilities.
@alvaroloes thanks. Actually enumer is some good piece of software. I'm using it in almost every new Go project. A lot more useful than cmd/stringer
. Especially the snake transform.
Kudos!
I created new pull request, that will make some updates to work with go modules. Please review:
@amanbolat Reviewed! please see comments
Everything should be working with the latest version (v1.1.0). Please run:
go get -u github.com/alvaroloes/enumer
and verify it is working. @gudvinr Could you please confirm it is working so that I can close the issue?
@alvaroloes yep, works like a charm. Finally I can benefit from the greatest tool in the Go world.
Haha, thanks! I'm glad you like it! 😃 Thank you very much for reporting issues and participating in the discussions 👏
With Go 1.11 release and go mod introduction I moved some projects that uses enumer out of
$GOPATH
and so now it can't generate code when package has some imports either because of built-in dependencies failing or because it just can't find import out of$GOPATH
.E.g. when I try to generate from this MWE:
Click to expand
```go package mwe import ( "log" ) type Type uint8 //go:generate enumer -type=Type -json -transform=snake const ( ConstOne Type = iota ConstTwo ) func init() { var a = ConstOne log.Println("a", a) } ```You'll get that: