Minor Error in Tour of Go?

98 views
Skip to first unread message

jlfo...@berkeley.edu

unread,
Aug 14, 2024, 8:04:08 PM8/14/24
to golang-nuts
In the Interfaces section of "A Tour of Go" it says

"A value of interface type can hold any value that implements those methods."

Shouldn't this be

"A variable of interface type can hold any value that implements those methods."

Jon

jlfo...@berkeley.edu

unread,
Aug 15, 2024, 7:26:36 PM8/15/24
to golang-nuts
Another example of this comes 2 pages later:

"An interface value holds a value of a specific underlying concrete type."

I suggest that this should be

"An interface variable holds a value of a specific underlying concrete type."

or

"An interface value is a value of a specific underlying concrete type."

Jon

Brian Candler

unread,
Aug 15, 2024, 9:46:07 PM8/15/24
to golang-nuts
I think it's correct as originally written.

IIUC, a value of interface type is essentially a box, which can contain a value of any other type which implements the desired methods. The box is immutable.
Reply all
Reply to author
Forward
0 new messages