我可以看到scanner.go该结构有一个error方法。
// A SyntaxError is a description of a JSON syntax error.
type SyntaxError struct {
msg string // description of error
Offset int64 // error occurred after reading Offset bytes
}
func (e *SyntaxError) Error() string { return e.msg }
但是编译器告诉我这个:
api/errors.go:24: impossible type switch case: err (type error) cannot have dynamic type json.SyntaxError (missing Error method) 尝试在类型上做开关盒时
func myFunction(err error) {
switch err.(type) {
case validator.ErrorMap, json.SyntaxError:
response.WriteErrorString(http.StatusBadRequest, "400: Bad Request")
//etc
为什么这不能编译?因为结构有Error方法。
肥皂起泡泡
使用条件构造器查询时,如果所有条件都不满足,是不是就是查询所有数据,而非满足条件的数据
如果满足BC范式足,是不是第一,第二,第三范式全部满足
为什么两个属性同时矛盾的存在的时候,只会满足3列的条件,而去不满足200px的条件?
在wait set中不满足条件的线程,被唤醒后是不是还是不满足条件?
相关分类