|
|
|
|
|
by ericbb
3948 days ago
|
|
This trick fits more into the "prank" category. package main
import "fmt"
// <Add one short line of valid Go code here>
func main() {
var n int = 1
fmt.Println(n)
}
Compiler: "prog.go:8: cannot use 1 (type int) as type int in assignment"
Here's a trick that I expected to work but doesn't. Would be interested to hear the rationale if anyone knows it. m := map[[]int]int{}
|
|
To recap: