Skip to content

Commit

Permalink
all: make staticcheck happier (#1150)
Browse files Browse the repository at this point in the history
* a value (allocation) that was never used
* unused field (fine to remove as per the library)
* simplify error return
  • Loading branch information
mvdan authored and buger committed Sep 27, 2017
1 parent 125d362 commit 1deacf4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
3 changes: 1 addition & 2 deletions analytics.go
Expand Up @@ -49,8 +49,7 @@ type GeoData struct {
} `maxminddb:"country"`

City struct {
GeoNameID uint `maxminddb:"geoname_id"`
Names map[string]string `maxminddb:"names"`
Names map[string]string `maxminddb:"names"`
} `maxminddb:"city"`

Location struct {
Expand Down
2 changes: 1 addition & 1 deletion main.go
Expand Up @@ -226,7 +226,7 @@ func getAPISpecs() []*APISpec {
}

func getPolicies() {
pols := make(map[string]Policy)
var pols map[string]Policy
log.WithFields(logrus.Fields{
"prefix": "main",
}).Info("Loading policies")
Expand Down
5 changes: 1 addition & 4 deletions res_handler_header_injector.go
Expand Up @@ -20,10 +20,7 @@ type HeaderInjector struct {

func (h *HeaderInjector) Init(c interface{}, spec *APISpec) error {
h.Spec = spec
if err := mapstructure.Decode(c, &h.config); err != nil {
return err
}
return nil
return mapstructure.Decode(c, &h.config)
}

func (h *HeaderInjector) HandleResponse(rw http.ResponseWriter, res *http.Response, req *http.Request, ses *SessionState) error {
Expand Down

0 comments on commit 1deacf4

Please sign in to comment.