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 <hein.mel...@gmail.com> wrote:
>
> 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,
> :) Hein
>
> --
> You received this message because you are subscribed to the Google Groups 
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/eae52a72-8e4a-40b2-aa64-f83a5024328fn%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CACoUkn4y57K3b-5Rm%3Dk9%2BDf8quk6MrOTK314hCNeGhOT9-w7oA%40mail.gmail.com.

Reply via email to