yujiachen-y / goaccessor

`goaccessor` is a Go tool designed to automate the generation of `getter` and `setter` boilerplate code for your types and variables.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Imports can't be recolved when type is a slice

cbrow111 opened this issue · comments

Decorate a struct definition like so:

//go:generate go run github.com/yujiachen-y/goaccessor@latest -g -s -t MyType
func MyType struct {
     x int
     y int
     s string
     t []otherPackageInMyProject.CustomType
}

The accessors for t generate successfully but the import for otherPackageInMyProject.CustomType does not resolve. If the type isn't a slice, the import resolves.