mirror of
https://github.com/gofiber/fiber.git
synced 2025-02-19 13:07:52 +00:00
go style updates
This commit is contained in:
parent
c4372a45db
commit
c62e5f7d4d
@ -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()))
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -25,10 +25,10 @@ func AssertEqual(t testing.TB, expected, actual interface{}, description ...stri
|
||||
var bType = "<nil>"
|
||||
|
||||
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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user