by RickySeltzer:
var each1 = []byte{'e', 'a', 'c', 'h'}
const each2 = []byte{'e', 'a', 'c', 'h'}
The 'var' is accepted, the 'const' is not. This is a defect in the language spec and
design.
1. What is a short input program that triggers the error?
http://play.golang.org/p/Jbo9waCn_h
2. What is the full compiler output?
prog.go:7: const initializer []byte literal is not a constant
[process exited with non-zero status]
by RickySeltzer:
var each1 = []byte{'e', 'a', 'c', 'h'} const each2 = []byte{'e', 'a', 'c', 'h'} The 'var' is accepted, the 'const' is not. This is a defect in the language spec and design. 1. What is a short input program that triggers the error? http://play.golang.org/p/Jbo9waCn_h 2. What is the full compiler output? prog.go:7: const initializer []byte literal is not a constant [process exited with non-zero status]