-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Replace Apache 2.0 licensed gopkg.in/yaml.v3 with MIT licensed github.com/goccy/go-yaml #1120
Conversation
We at @Icinga are developing applications under GPLv2. Unfortunately due to its viral copyleft nature it's not compatible with the Apache 2.0 license. And even more unfortunately at the moment your MIT licensed lib depends on the Apache 2.0 licensed gopkg.in/yaml.v3 which makes it unusable for us (Icinga/icingadb#381). This PR shall fix that... mostly. Now there are only permissively licensed non-golang.org/x deps ex. gopkg.in/yaml.v2 ( |
Now with goccy/go-yaml#260 it should be feature-equivalent. |
….com/goccy/go-yaml ... to be compatible with GPLv2 applications.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
goccy/go-yaml brings too many dependencies which should not be needed for YAML serialization: go-colorable
, go-isatty
...
=> wontfix
Make the YAML dependency required for {assert,require}.YAMLEq{,f} pluggable. The implementation can be selected using build tags: - testify_yaml_default (default): gopkg.in/yaml.v3 is used, like before - testify_yaml_fail: YAML deserialization is not implemented and always fails. So assert.YAMLEq always fails. This is useful if the test suite package doesn't use assert.YAMLEq (very common case). - testify_yaml_custom: the github.com/stretchr/testify/assert/yaml package exposes an Unmarshal variable of type func([]byte, any) error (same as gopkg.in/yaml.v3) that allows to plug any alternate implementation. For example github.com/goccy/go-yaml.Unmarshal. This allows to avoid the link constraints of the license of gopkg.in/yaml.v3 (see PR #1120). Usage: go test -tags testify_yaml_fail To install the alternate implementation with testify_yaml_custom: //go:build testify_yaml_custom package my_pkg_test import ( goyaml "github.com/goccy/go-yaml" "github.com/stretchr/testify/assert/yaml" ) func init() { yaml.Unmarshal = goyaml.Unmarshal }
Make the YAML dependency required for {assert,require}.YAMLEq{,f} pluggable. The implementation can be selected using build tags: - testify_yaml_default (default): gopkg.in/yaml.v3 is used, like before - testify_yaml_fail: YAML deserialization is not implemented and always fails. So assert.YAMLEq always fails. This is useful if the test suite package doesn't use assert.YAMLEq (very common case). - testify_yaml_custom: the github.com/stretchr/testify/assert/yaml package exposes an Unmarshal variable of type func([]byte, any) error (same as gopkg.in/yaml.v3) that allows to plug any alternate implementation. For example github.com/goccy/go-yaml.Unmarshal. This allows to avoid the link constraints of the license of gopkg.in/yaml.v3 (see PR #1120). Usage: go test -tags testify_yaml_fail To install the alternate implementation with testify_yaml_custom: //go:build testify_yaml_custom package my_pkg_test import ( goyaml "github.com/goccy/go-yaml" "github.com/stretchr/testify/assert/yaml" ) func init() { yaml.Unmarshal = goyaml.Unmarshal }
... to be compatible with GPLv2 applications.