Merge pull request #37091 from thaJeztah/fix-linting-errors

Fix some linting issues
Upstream-commit: 1b75e175842e5ef59284a1c8ca7d64e4d6b62384
Component: engine
This commit is contained in:
Tibor Vass
2018-05-19 08:39:39 -10:00
committed by GitHub
12 changed files with 23 additions and 19 deletions
+5 -1
View File
@@ -126,7 +126,11 @@ func (s *Server) makeHTTPHandler(handler httputils.APIFunc) http.HandlerFunc {
// apply to all requests. Data that is specific to the
// immediate function being called should still be passed
// as 'args' on the function call.
ctx := context.WithValue(context.Background(), dockerversion.UAStringKey, r.Header.Get("User-Agent"))
// use intermediate variable to prevent "should not use basic type
// string as key in context.WithValue" golint errors
var ki interface{} = dockerversion.UAStringKey
ctx := context.WithValue(context.Background(), ki, r.Header.Get("User-Agent"))
handlerFunc := s.handlerWithGlobalMiddlewares(handler)
vars := mux.Vars(r)