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
What does 'go version' print?
go1.2.1
What steps reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. http://play.golang.org/p/npUWWoTYip
What happened?
map[int]uint8(nil)
[]byte{}
What should have happened instead?
map[int]uint8(nil)
[]byte(nil)
Please provide any additional information below.
The text was updated successfully, but these errors were encountered:
The real problem is that the printing of a nil slice is wrong.
http://play.golang.org/p/68k5ZUqzKd
package main
import "fmt"
func main() {
var y []byte
fmt.Printf("%#v\n", y)
y = []byte{}
fmt.Printf("%#v\n", y)
}
prints
[]byte{}
[]byte{}
but should print
[]byte(nil)
[]byte{}
This is a bug and should be fixed.
by leterip:
The text was updated successfully, but these errors were encountered: