C の弱点 default のスペルミスを継承していた
no more creat。
package main import "fmt" func main() { a := 4; switch a { case 0, 1, 2: fmt.Println( a ); case 3: fmt.Println( "いっぱい" ); defuuuuult: fmt.Println( "defuuuuuuult" ); /* default: fmt.Println( "default" ); */ } }
何も表示されません。
文法見ると禁止されてるっぽいのに、穴がありますね。「defuuuuult:」は前の「case 3:」に続く StatementList 中のラベルになってるのかも。
「$ hg log」したらこんなのが。やられたw
changeset: 3956:4a3f6bbb5f0c user: Ken Thompsondate: Tue Nov 10 15:05:15 2009 -0800 summary: spell it with an "e"
$ hg log -r3956 -p
+ O_CREATE = O_CREAT; // create a new file if none exists.