4 ms·All variables in Go are function-scoped. They are just being consistent with the overall design in this case.by hcnews 8y agoAll variables in Go are function-scoped. They are just being consistent with the overall design in this case.cdoxsey 8y agoVariables are lexically scoped by blocks: https://golang.org/ref/spec#Blocks https://golang.org/ref/spec#Blockspcwalton 8y agoNo, they aren't: https://play.golang.org/p/MwDSkoFaOX4 https://play.golang.org/p/MwDSkoFaOX4deleted 8y ago[deleted]