For some test in CI, it only needs jsonnetfmt cmd, but it failed with go install"
# go install 'github.com/google/go-jsonnet/cmd/jsonnetfmt'
can't load package: package github.com/google/go-jsonnet/cmd/jsonnetfmt: module github.com/google/go-jsonnet@latest found (v0.14.0), but does not contain package github.com/google/go-jsonnet/cmd/jsonnetfmt
Download binary pkg is not very cool in CI test, WDYT @sbarzowski ?
The only supported version of jsonnetfmt is the C++ one at the moment (because it's implementation defined, we don't want to support two version at the same time). So using a binary release be my default recommendation in this case. You may ofc also compile the C++ version - there are very few dependencies and it should take only a few seconds (still using a binary release is probably easier and faster for CI).
If you feel adventurous you may try using a fairly complete WIP by @sparkprime: https://github.com/sparkprime/go-jsonnet/tree/formatter.
@sparkprime BTW what is left to do before we can merge the Go implementation of jsonnetfmt and declare it the primary one?
Happy to heard it, beside CI test, there is too much env that does not support high C++ version, like CentOS7.6.
@sbarzowski Could share the implement process in this issue and close until implement done?
Sorry for my absenteeism!
There are few test cases still failing with the Go formatter. It's actually probably already useful so maybe we should disable those tests and merge it.
Yesterday I rebased it and it seems to be in the same condition I left it in, which is good!
What remains is:
@sparkprime That sounds great! Where could we track the progress for go formatter? I'd love to help if I can anyhow.
pull https://github.com/sparkprime/go-jsonnet/tree/formatter, I just updated it. I will push -f in future though.
you should find the binary next to the regular jsonnet one and it should be self explanatory
Ok now we're down to just google/go-jsonnet#314
@sbarzowski @sparkprime Since https://github.com/google/go-jsonnet/pull/388 is merged, could we say this is done?
Yes, you can now install the Go version of jsonnetfmt by running:
go get github.com/google/go-jsonnet/cmd/jsonnetfmt
Most helpful comment
Yes, you can now install the Go version of
jsonnetfmtby running: