Thanks a lot for the tips. This repo is working out and should hold me 
over, as Ian mentioned, until golang.org/x/mod/modfile is out.

On Tuesday, September 3, 2019 at 12:26:28 AM UTC-7, Paul Jolly wrote:
>
> Also note that you can run: 
>
>     go mod edit -json 
>
> and get JSON output. 
>
>     go help mod edit 
>
> will given you the types you can then use to unmarshal the JSON. 
>
> Failing that, the code that Dan referenced has been factored out into: 
>
>     https://godoc.org/github.com/rogpeppe/go-internal/modfile 
>
> On Tue, 3 Sep 2019 at 08:21, James Pettyjohn <japet...@gmail.com 
> <javascript:>> wrote: 
> > 
> > Thanks. I saw the same being done by vgo - might be viable. 
> > 
> > On Monday, September 2, 2019 at 10:52:45 PM UTC-7, kortschak wrote: 
> >> 
> >> Not really exposed, but there is code you could copy. 
> >> 
> >> https://golang.org/pkg/cmd/go/internal/modfile/#Parse 
> >> 
> >> On Mon, 2019-09-02 at 22:44 -0700, James Pettyjohn wrote: 
> >> > Hi, 
> >> > 
> >> > This might be a bad idea but I'm trying to parse the go.mod file for 
> >> > data 
> >> > as part of my build process - if at all possible I'd like to avoid 
> >> > duplicating the data that is already there in another file. 
> >> > 
> >> > Is there an exposed package that can be used for this? 
> >> > 
> >> > - J 
> >> > 
> >> 
> > -- 
> > 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 golan...@googlegroups.com <javascript:>. 
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/7a06f505-187e-473f-b748-a8bf7f114bf6%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/2a4fd111-ffaf-4c9c-a427-f10c04af6f35%40googlegroups.com.

Reply via email to