Re: [go-nuts] go modules introspection

2018-09-07 Thread Paul Jolly
Hi Jens, > Is there a clean way to identify if the current working directory is a go > module and to get module information from go.mod (i.e. a parser fo go.mod > files)? go env GOMOD > I did seach the documentation on golang.org but could not find any > information. Depends on what you

[go-nuts] go modules introspection

2018-09-07 Thread Jens Hausherr
Hi , is there a way to acces go module information programmatically? Background: I am currently using spf13's cobra. It currently only works with packages inside GOPATH. Is there a clean way to identify if the current working directory is a go module and to get module information from go.mod