x/blog: short code snippet in tutorial written pre-go1 no longer compiles #34232
Labels
Documentation
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I think the example on the tutorial is wrong
https://blog.golang.org/gos-declaration-syntax
At the end sector 'Pointer':
they declare a variable that i think it a integer nil pointer like this: []int("hi")
but i think the author is mistook with the : []int(nil)
What did you expect to see?
It run, cause it's a tutorial
What did you see instead?
the compiler throw back with the error:
command-line-arguments
.\test.go:10:14: cannot convert "hi" (type string) to type []int
The text was updated successfully, but these errors were encountered: