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

Deprecate methods added in Go 1.23 #35

Merged
merged 3 commits into from
Aug 26, 2024

Conversation

stefafafan
Copy link
Contributor

Go 1.23 added methods to the standard slices and maps packages.
ref. https://go.dev/doc/go1.23

Some of them were also defined in hatena/godash so I marked them as deprecated to point users to use the standard library.

@lufia
Copy link
Member

lufia commented Aug 20, 2024

@stefafafan Hi! Thank you!

But I'm little worry golangci-lint raises warnings about using deprecated functions when the main module using this depends on Go 1.22.

Could you add new Go source with //go:build go1.23 build constraints for marking as deprecated? Or I can steal that task.

@stefafafan
Copy link
Contributor Author

@lufia Thank you!!

But I'm little worry golangci-lint raises warnings about using deprecated functions when the main module using this depends on Go 1.22.

Good point. Would that be like, having separate Go files (e.g. godash_123.go and godash_122.go ) with separate build constraints?

Or I can steal that task.

I think maybe I will let you steal the task. 🙏🏻

@lufia lufia force-pushed the deprecate-go-123-functions branch from 974eb2d to d450876 Compare August 26, 2024 02:23
@lufia
Copy link
Member

lufia commented Aug 26, 2024

@stefafafan

Would that be like, having separate Go files with separate build constraints?

Yes, I did it on d450876

@lufia
Copy link
Member

lufia commented Aug 26, 2024

ok

$ go version
go version go1.23.0 linux/amd64

$ go doc -all
...
func Values[K comparable, V any](in map[K]V) []V
    Values returns the values of the map as a slice.

    Deprecated: Use https://pkg.go.dev/maps#Values instead.

$ GOTOOLCHAIN=go1.22.6 go doc -all
...
func Values[K comparable, V any](in map[K]V) []V
    Values returns the values of the map as a slice.

@lufia lufia merged commit 33fd982 into hatena:main Aug 26, 2024
2 checks passed
@hatena-godash-app hatena-godash-app bot mentioned this pull request Aug 26, 2024
@stefafafan stefafafan deleted the deprecate-go-123-functions branch August 26, 2024 06:44
@stefafafan
Copy link
Contributor Author

Thanks!

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.

2 participants