Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow build without json and xml support #1556

Merged
merged 3 commits into from Mar 1, 2023

Conversation

afbjorklund
Copy link
Contributor

When using yqlib from a project only for the YAML support, it is not needed with JSON support or XML support.

The encoding/json and encoding/xml makes the library almost twice as big, so allow compiling without those.

go build -tags "yq_nojson yq_noxml" -o yq

Trying to use them, will report error instead.


Top 10 libraries, yaml (1813K) ~ json + xml (2077K)

1813	gopkg.in/yaml.v3
1478	syscall
1083	encoding/json
994	encoding/xml
917	time
830	os
773	fmt
677	regexp
650	github.com/magiconair/properties
552	math

Separate json and xml, from the regular yaml.

Makes it possible to compile, without those...
Use more consistent parameters vs globals

Return errors instead of calling panic()
@mikefarah mikefarah merged commit cf8cfbd into mikefarah:master Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants