In a project I need to find a package by its import path.
It seems that the only API available is via the go list command, so I'm
Here are some problems I found:
- The go list help documents the Package type, however some two fields have
the PackageError type, and this is not documented.
- What is the reason why the Package type documented in the go list command
is not exported from the go/build package?
- I my command I need to detect if the <import path> specified by the user
exists, and I do it by checking if JSON decoder returns EOF.
However I would like to print a custom error message depending on <import
path>. If it is a pattern I want to report "%q matched no package",
otherwise "cannot find package %q".
How can I check if import path is a pattern? strings.Index("...") ?
- What is the reason why the functionality of go list is not available as
an API in the go/build package?
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 email@example.com.
For more options, visit https://groups.google.com/d/optout.