gmsm
gmsm copied to clipboard
[go1.18] change interface{} to any, and remove "+build" build tag
-
change interface{} to any gofmt -w -r 'interface{} -> any' ./...
-
remove "+build" tag go fix -fix=buildtag
//go:build lines Go 1.17 introduced //go:build lines as a more readable way to write build constraints, instead of // +build lines. As of Go 1.17, gofmt adds //go:build lines to match existing +build lines and keeps them in sync, while go vet diagnoses when they are out of sync.
Since the release of Go 1.18 marks the end of support for Go 1.16, all supported versions of Go now understand //go:build lines. In Go 1.18, go fix now removes the now-obsolete // +build lines in modules declaring go 1.18 or later in their go.mod files.
For more information, see https://go.dev/design/draft-gobuild.
The new predeclared identifier any is an alias for the empty interface. It may be used instead of interface{}.