You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example, fmt.Print takes any number of arguments of type interface{}
While this statement is technically correct, the actual implementation of fmt.Print in Go uses any instead of interface{}. This could cause confusion for newcomers, as the example uses the older syntax while the implementation reflects the modern alias.
I think it'll be useful to update the text to clarify that any is an alias for interface{}, ensuring consistency with the source code state
The text was updated successfully, but these errors were encountered:
desabuh
changed the title
tour: [Clarify usage of any as an alias for interface{} in fmt.Print description]
tour: Clarify usage of any as an alias for interface{} in fmt.Print description
Nov 17, 2024
Context: https://go.dev/tour/methods/14
In the Methods and Interfaces - Empty Interface section, the current text states:
While this statement is technically correct, the actual implementation of
fmt.Print
in Go usesany
instead ofinterface{}
. This could cause confusion for newcomers, as the example uses the older syntax while the implementation reflects the modern alias.I think it'll be useful to update the text to clarify that
any
is an alias forinterface{}
, ensuring consistency with the source code stateThe text was updated successfully, but these errors were encountered: