Hi kalekold, It looks like it is a stream of JSON objects?
If so, I suspect this is expected? See related discussion here (for 'go list -m -u -json' in this case), along with sample code for parsing: https://github.com/golang/go/issues/27655 --thepudds On Saturday, October 6, 2018 at 12:26:32 PM UTC-4, kalekold wrote: > > It should be: > > [{ > "Path": "github.com/fatih/color", "Version": "v1.7.0", > "Info": "/media/Data/Projects/Go/pkg/mod/cache/download/ > github.com/fatih/color/@v/v1.7.0.info", > "GoMod": "/media/Data/Projects/Go/pkg/mod/cache/download/ > github.com/fatih/color/@v/v1.7.0.mod", > "Zip": "/media/Data/Projects/Go/pkg/mod/cache/download/ > github.com/fatih/color/@v/v1.7.0.zip", > "Dir": "/media/Data/Projects/Go/pkg/mod/github.com/fatih/color@v1.7.0", > "Sum": "h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=", > "GoModSum": "h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=" > },{ > ... > }] > > Notice the array, it's missing in the example above. This means this > output can not be parsed. > > On Saturday, 6 October 2018 17:24:35 UTC+1, kalekold wrote: >> >> I simply run `go mod download -json` and it outputs this (which isn't >> valid.) >> >> { >> "Path": "github.com/fatih/color", >> "Version": "v1.7.0", >> "Info": "/media/Data/Projects/Go/pkg/mod/cache/download/ >> github.com/fatih/color/@v/v1.7.0.info", >> "GoMod": "/media/Data/Projects/Go/pkg/mod/cache/download/ >> github.com/fatih/color/@v/v1.7.0.mod", >> "Zip": "/media/Data/Projects/Go/pkg/mod/cache/download/ >> github.com/fatih/color/@v/v1.7.0.zip", >> "Dir": "/media/Data/Projects/Go/pkg/mod/github.com/fatih/color@v1.7.0", >> "Sum": "h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=", >> "GoModSum": "h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=" >> } >> { >> "Path": "github.com/mattn/go-colorable", >> "Version": "v0.0.9", >> "Info": "/media/Data/Projects/Go/pkg/mod/cache/download/ >> github.com/mattn/go-colorable/@v/v0.0.9.info", >> "GoMod": "/media/Data/Projects/Go/pkg/mod/cache/download/ >> github.com/mattn/go-colorable/@v/v0.0.9.mod", >> "Zip": "/media/Data/Projects/Go/pkg/mod/cache/download/ >> github.com/mattn/go-colorable/@v/v0.0.9.zip", >> "Dir": "/media/Data/Projects/Go/pkg/mod/ >> github.com/mattn/go-colorable@v0.0.9", >> "Sum": "h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4=", >> "GoModSum": "h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=" >> } >> { >> "Path": "github.com/mattn/go-isatty", >> "Version": "v0.0.4", >> "Info": "/media/Data/Projects/Go/pkg/mod/cache/download/ >> github.com/mattn/go-isatty/@v/v0.0.4.info", >> "GoMod": "/media/Data/Projects/Go/pkg/mod/cache/download/ >> github.com/mattn/go-isatty/@v/v0.0.4.mod", >> "Zip": "/media/Data/Projects/Go/pkg/mod/cache/download/ >> github.com/mattn/go-isatty/@v/v0.0.4.zip", >> "Dir": "/media/Data/Projects/Go/pkg/mod/ >> github.com/mattn/go-isatty@v0.0.4", >> "Sum": "h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs=", >> "GoModSum": "h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=" >> } >> { >> "Path": "golang.org/x/sys", >> "Version": "v0.0.0-20181005133103-4497e2df6f9e", >> "Info": "/media/Data/Projects/Go/pkg/mod/cache/download/ >> golang.org/x/sys/@v/v0.0.0-20181005133103-4497e2df6f9e.info", >> "GoMod": "/media/Data/Projects/Go/pkg/mod/cache/download/ >> golang.org/x/sys/@v/v0.0.0-20181005133103-4497e2df6f9e.mod", >> "Zip": "/media/Data/Projects/Go/pkg/mod/cache/download/ >> golang.org/x/sys/@v/v0.0.0-20181005133103-4497e2df6f9e.zip", >> "Dir": "/media/Data/Projects/Go/pkg/mod/ >> golang.org/x/sys@v0.0.0-20181005133103-4497e2df6f9e", >> "Sum": "h1:EfdBzeKbFSvOjoIqSZcfS8wp0FBLokGBEs9lz1OtSg0=", >> "GoModSum": "h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=" >> } >> >> >> On Saturday, 6 October 2018 16:24:42 UTC+1, Ian Davis wrote: >>> >>> On Sat, 6 Oct 2018, at 3:07 PM, 'kalekold' via golang-nuts wrote: >>> >>> `go mod download -json` does not product valid json? Is this a known >>> issue or am I missing something? >>> >>> >>> Do you have an example that shows the invalid json? >>> >>> -- 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. For more options, visit https://groups.google.com/d/optout.