diff --git a/internal/schema/decoder.go b/internal/schema/decoder.go index 025e438b56..28b560bbbb 100644 --- a/internal/schema/decoder.go +++ b/internal/schema/decoder.go @@ -193,7 +193,7 @@ func (d *Decoder) decode(v reflect.Value, path string, parts []pathPart, values if v.Type().Kind() == reflect.Struct { for i := 0; i < v.NumField(); i++ { field := v.Field(i) - if field.Type().Kind() == reflect.Ptr && field.IsNil() && v.Type().Field(i).Anonymous == true { + if field.Type().Kind() == reflect.Ptr && field.IsNil() && v.Type().Field(i).Anonymous { field.Set(reflect.New(field.Type().Elem())) } } diff --git a/router.go b/router.go index 6ae723b400..b8fd98b639 100644 --- a/router.go +++ b/router.go @@ -423,7 +423,7 @@ func (app *App) addRoute(method string, route *Route) { // buildTree build the prefix tree from the previously registered routes func (app *App) buildTree() *App { - if app.routesRefreshed == false { + if !app.routesRefreshed { return app } // loop all the methods and stacks and create the prefix tree diff --git a/utils/assertions.go b/utils/assertions.go index 30b7fc0271..348e3985ed 100644 --- a/utils/assertions.go +++ b/utils/assertions.go @@ -25,10 +25,10 @@ func AssertEqual(t testing.TB, expected, actual interface{}, description ...stri var bType = "" if expected != nil { - aType = fmt.Sprintf("%s", reflect.TypeOf(expected)) + aType = reflect.TypeOf(expected).String() } if actual != nil { - bType = fmt.Sprintf("%s", reflect.TypeOf(actual)) + bType = reflect.TypeOf(actual).String() } testName := "AssertEqual"