Skip to content

Instantly share code, notes, and snippets.

@ironsmile
Last active January 2, 2016 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ironsmile/b6c2d15f5fa4b334a408 to your computer and use it in GitHub Desktop.
Save ironsmile/b6c2d15f5fa4b334a408 to your computer and use it in GitHub Desktop.
Golang's strange len operator
package main
func main() {
var buff = make([]byte, 1024)
var out string
out = out + string(buff)
println(out) // nothing, as expected
println(len(out)) // 1024 !?
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment