Hi,
You want to be using https://pkg.go.dev/golang.org/x/tools/go/packages
The docs include an example of how to do this.
Thanks,
Paul
On Thu, 17 Sep 2020 at 12:29, Hein Meling wrote:
>
> Hi all,
>
> I'm trying to get info about the package, but the code below returns an empty
>
Hi all,
I'm trying to get info about the package, but the code below returns an
empty build.Package struct... Anyone know how to use this API to get a
populated Package struct?
p, err := build.ImportDir("../paging", build.FindOnly)
if err != nil {
t.Error(err)
}
fmt.Println(p)
Thanks,
:)