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

viper go.mod has dependency issues from 1.17.0 #1772

Open
3 tasks done
andy12593 opened this issue Feb 26, 2024 · 5 comments
Open
3 tasks done

viper go.mod has dependency issues from 1.17.0 #1772

andy12593 opened this issue Feb 26, 2024 · 5 comments
Labels
kind/bug Something isn't working

Comments

@andy12593
Copy link

andy12593 commented Feb 26, 2024

Preflight Checklist

  • I have searched the issue tracker for an issue that matches the one I want to file, without success.
  • I am not looking for support or already pursued the available support channels without success.
  • I have checked the troubleshooting guide for my problem, without success.

Viper Version

1.17.0

Go Version

1.18

Config Source

Files

Format

TOML

Repl.it link

No response

Code reproducing the issue

No response

Expected Behavior

go run main.go success without error

Actual Behavior

go run main.go error:
The reason is that github.com/spf13/viper@v1.17.0 only requires go 1.18, but the dependency github.com/sagikazarmark/slog-shim v0.1.0 requires go 1.20

# golang.org/x/exp/slog
/home/oppo/go/pkg/mod/golang.org/x/exp@v0.0.0-20230905200255-921286631fa9/slog/level.go:159:13: undefined: atomic.Int64
/home/oppo/go/pkg/mod/golang.org/x/exp@v0.0.0-20230905200255-921286631fa9/slog/attr.go:20:19: undefined: StringValue
/home/oppo/go/pkg/mod/golang.org/x/exp@v0.0.0-20230905200255-921286631fa9/slog/attr.go:68:19: undefined: GroupValue
/home/oppo/go/pkg/mod/golang.org/x/exp@v0.0.0-20230905200255-921286631fa9/slog/handler.go:446:15: undefined: StringValue
/home/oppo/go/pkg/mod/golang.org/x/exp@v0.0.0-20230905200255-921286631fa9/slog/json_handler.go:109:20: v.str undefined (type Value has no field or method str)
/home/oppo/go/pkg/mod/golang.org/x/exp@v0.0.0-20230905200255-921286631fa9/slog/record.go:192:9: undefined: GroupValue
/home/oppo/go/pkg/mod/golang.org/x/exp@v0.0.0-20230905200255-921286631fa9/slog/text_handler.go:99:20: v.str undefined (type Value has no field or method str)
/home/oppo/go/pkg/mod/golang.org/x/exp@v0.0.0-20230905200255-921286631fa9/slog/value.go:87:7: undefined: stringptr
/home/oppo/go/pkg/mod/golang.org/x/exp@v0.0.0-20230905200255-921286631fa9/slog/value.go:91:7: undefined: groupptr
/home/oppo/go/pkg/mod/golang.org/x/exp@v0.0.0-20230905200255-921286631fa9/slog/value.go:173:10: undefined: StringValue
/home/oppo/go/pkg/mod/golang.org/x/exp@v0.0.0-20230905200255-921286631fa9/slog/value.go:173:10: too many errors
note: module requires Go 1.20

Steps To Reproduce

  1. go get github.com/spf13/viper@v1.17.0
  2. go mod tidy
  3. go run main.go

Additional Information

No response

@andy12593 andy12593 added the kind/bug Something isn't working label Feb 26, 2024
Copy link

👋 Thanks for reporting!

A maintainer will take a look at your issue shortly. 👀

In the meantime: We are working on Viper v2 and we would love to hear your thoughts about what you like or don't like about Viper, so we can improve or fix those issues.

⏰ If you have a couple minutes, please take some time and share your thoughts: https://forms.gle/R6faU74qPRPAzchZ9

📣 If you've already given us your feedback, you can still help by spreading the news,
either by sharing the above link or telling people about this on Twitter:

https://twitter.com/sagikazarmark/status/1306904078967074816

Thank you! ❤️

@gotostack
Copy link

This commit introduced the slog:
d16deb4

Then the viper from v1.17.0 will require golang 1.20.

Roll back the viper to v1.16.0 works for golang 1.18 for my project.

@sagikazarmark
Copy link
Collaborator

As per the Go version support policy we support the last two Go versions. We may have forgotten to update the go.mod file.

@andy12593
Copy link
Author

As per the Go version support policy we support the last two Go versions. We may have forgotten to update the go.mod file.

Yes, the mod file after tag 1.7.0 should be updated from go 1.18 to 1.20. It is recommended to add tag 1.7.1 1.8.3 for this purpose.

@sagikazarmark
Copy link
Collaborator

Not sure how that would change anything. If a transitive dependency requires a higher Go version, that's virtually the same as Viper requiring it as well. I doubt Go would behave differently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants