github.com/tencent/goom@v1.0.1/erro/field_not_found.go (about) 1 package erro 2 3 // FieldNotFound 类型没有找到 4 type FieldNotFound struct { 5 typName string 6 fieldName string 7 } 8 9 // Error 返回错误字符串 10 func (t *FieldNotFound) Error() string { 11 return "field not found: " + t.typName + "." + t.fieldName 12 } 13 14 // NewFieldNotFoundError 创建类型未找到异常 15 // typName 类型名称 16 // fieldName 属性名称 17 func NewFieldNotFoundError(typName string, fieldName string) error { 18 return &FieldNotFound{typName: typName, fieldName: fieldName} 19 }