Golang的fallthrough与switch的坑
创 Golang的fallthrough与switch的坑 梦朝思夕 关注 0人评论 544人阅读 2017-06-06 16:08:19 最近写Golang的是发现一个fallthrough与switch的坑:switch value.(type) { case int: fallthrough case int64: //...... }编译就报错:cannot fallthrough in type switchWHAT????在type switch 中不能使用fallthrough只能修改代码:switch value.(type) { case int , int64: //...... } ©著作权归作者所有:来自51CTO博客作者梦朝思夕的原创作品,如需转载,请注明出处,否则...阅读全文