最近写Golang的是发现一个fallthrough与switch的坑:

switch value.(type) {
    case int:
        fallthrough
    case int64:
        //......
}

编译就报错:

cannot fallthrough in type switch

WHAT????

在type switch 中不能使用

fallthrough

只能修改代码:

switch value.(type) {
    case int , int64:
        //......
}