Golang的fallthrough与switch的坑
最近写Golang的是发现一个fallthrough与switch的坑:
switchvalue.(type){caseint:fallthroughcaseint64://......}
编译就报错:
cannotfallthroughintypeswitch
WHAT????
在typeswitch 中不能使用
fallthrough
只能修改代码:
switchvalue.(type){caseint,int64://......}
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。