Skip to content

Commit

Permalink
all: simplify a couple of bool assigns
Browse files Browse the repository at this point in the history
The default value of a bool is false, so no need to set that again.

Also, "if x { y = true } else { y = false }" can be just "y = x".
  • Loading branch information
mvdan committed May 11, 2017
1 parent efc4941 commit dbb7292
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
2 changes: 0 additions & 2 deletions event_handler_webhooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ func (w *WebHookHandler) New(handlerConf interface{}) (TykEventHandler, error) {
defaultPath := filepath.Join(config.TemplatePath, "default_webhook.json")
webHookTemplate, _ = template.ParseFiles(defaultPath)
templateLoaded = true
} else {
templateLoaded = false
}
}

Expand Down
6 changes: 1 addition & 5 deletions gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -847,11 +847,7 @@ func testHttp(t *testing.T, tests []tykHttpTest, separateControlPort bool) {
config.ControlAPIPort, _ = strconv.Atoi(port)
}

if m.overrideDefaults {
config.HttpServerOptions.OverrideDefaults = true
} else {
config.HttpServerOptions.OverrideDefaults = false
}
config.HttpServerOptions.OverrideDefaults = m.overrideDefaults

// Ensure that no local API's installed
os.RemoveAll(config.AppPath)
Expand Down

0 comments on commit dbb7292

Please sign in to comment.