Closed applejag closed 6 months ago
In short, I think YAML support should be built-in and always available. This makes it an exception from my standard rules, and means what you have here is good as-is.
This addition aside, I did write a bit more about the general rules here: https://risor.io/docs/contributing_modules
Back to this PR... I only wonder if you also need an addition to cmd/risor/root.go to activate it in the CLI? I don't think the CLI uses the "all" module.
Back to this PR... I only wonder if you also need an addition to cmd/risor/root.go to activate it in the CLI? I don't think the CLI uses the "all" module.
Nevermind, this is working well in the CLI. Looks good!
Adds a YAML module.
I was very unsure on where to register the module. I thought just adding it to
modules/all/all.go
would suffice, but that didn't seem like it.I added it everywhere the JSON module was registered, even in the
decode
andencode
builtins insidebuiltins/codecs.go
.This adds a new dependency:
gopkg.in/yaml.v3
. Given this, should the YAML module then have a build flag?