1024programmer Java Go uses ‘any’ instead of interface{}

Go uses ‘any’ instead of interface{}

The latest release of Go 1.18 Beta 1 contains a noteworthy commit, which was submitted by Russ Cox, the technical leader of the Go development team. The commit content is to use the gofmt command to replace all ‘interface{}’ in the Go source code with ‘any’ ‘.

 gofmt -w -r 'interface{} -> any' src

This commit page shows 445 modified files.

rsc wrote that after executing the command, it will Restore the bootstrap cmd directory and some test data and adjust the tests as needed. Booted changes in std will not be reverted, as some of these changes will appear in the API documentation and the development team would like to be able to use ‘any’ consistently.

It is understood that this is the type alias syntax, which was mainly introduced for generics. The latest release of Go 1.8 Beta1 has brought generic support.

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/770314

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us


Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top