We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
go version
go env
as you can see it's a bit tricky to hit as - what i can see - there's a need to totally loose the original type information via a struct.
the compiler however is correct in this case, as if you uncomment lines 27 - 29 you get a compile time error:
prog.go:27: cannot range over ss (type interface {})
The text was updated successfully, but these errors were encountered:
Let's move this to a forum. See https://golang.org/wiki/Questions
The type of atype ...interface{} is indeed []interface{}.
atype ...interface{}
[]interface{}
Sorry, something went wrong.
but why is there a difference between the compiler and fmt?
There is no difference. The compiler's error message is correct.
Let's move this to a forum and discuss there.
but i said it's not a compiler bug, but a bug in fmt.
https://forum.golangbridge.org/t/difference-between-fmt-and-the-compiler-regarding-interface/2116
No branches or pull requests
go version
)?go1.6
go env
)?amd64 / linux
https://play.golang.org/p/aPx9TXrNaQ
[]interface {}, interface {} = test
[]interface {}, []interface {} = [test]
as you can see it's a bit tricky to hit as - what i can see - there's a need to totally loose the original type information via a struct.
the compiler however is correct in this case, as if you uncomment lines 27 - 29 you get a compile time error:
prog.go:27: cannot range over ss (type interface {})
The text was updated successfully, but these errors were encountered: