Linting and optimizing struct memory signature. (#1184)

* fix cleanPath spell (#969)

* linter and optimize structs
This commit is contained in:
Boris Borshevsky
2017-11-29 04:50:14 +02:00
committed by Bo-Yi Wu
parent eeb57848ca
commit 6f94fd05c9
11 changed files with 27 additions and 48 deletions

View File

@ -179,12 +179,3 @@ func setTimeField(val string, structField reflect.StructField, value reflect.Val
value.Set(reflect.ValueOf(t))
return nil
}
// Don't pass in pointers to bind to. Can lead to bugs. See:
// https://github.com/codegangsta/martini-contrib/issues/40
// https://github.com/codegangsta/martini-contrib/pull/34#issuecomment-29683659
func ensureNotPointer(obj interface{}) {
if reflect.TypeOf(obj).Kind() == reflect.Ptr {
panic("Pointers are not accepted as binding models")
}
}