go:generate stringer undeclared name: CONST

105 views Asked by At

I've used stringer to generate a String() method for different types and have put the output directory to stringer/

//go:generate -type TYPE -output stringer/TYPE_string.go

But stringer doesn't recognize the package and therefore generates

var x [1]struct{}
    _ = x[ENUM-0]

instead of

var x [1]struct{}
    _ = x[model.ENUM-0]

Is there any workaround or method that can help me generate the code in a different directory ?

0

There are 0 answers