Fix Workhorse linter warnings (part 35)
Problem
make golangci
linter detects warnings in following Workhorse files
How to verify
make golangci | grep -E "^internal/upstream/upstream"
internal/upstream/upstream.go:115: internal/upstream/upstream.go:115: Line contains TODO/BUG/FIXME/NOTE/OPTIMIZE/HACK: "TODO: move to LabKit https://gitlab.com/..." (godox)
internal/upstream/upstream.go:37:2: exported: exported var DefaultBackend should have comment or be unexported (revive)
internal/upstream/upstream.go:41:2: var-naming: var geoProxyApiPollingInterval should be geoProxyAPIPollingInterval (revive)
internal/upstream/upstream.go:64:1: exported: exported function NewUpstream should have comment or be unexported (revive)
internal/upstream/upstream.go:7:1: ST1000: at least one file in a package should have a package comment (stylecheck)
internal/upstream/upstream_test.go:104:34: string `{"geo_enabled":false}` has 3 occurrences, make it a constant (goconst)
internal/upstream/upstream_test.go:110:2: var-naming: var remoteServerUrl should be remoteServerURL (revive)
internal/upstream/upstream_test.go:232:23: var-naming: var waitForNextApiPoll should be waitForNextAPIPoll (revive)
internal/upstream/upstream_test.go:286:23: var-naming: var waitForNextApiPoll should be waitForNextAPIPoll (revive)
internal/upstream/upstream_test.go:289:10: response body must be closed (bodyclose)
internal/upstream/upstream_test.go:296:10: response body must be closed (bodyclose)
internal/upstream/upstream_test.go:303:10: response body must be closed (bodyclose)
internal/upstream/upstream_test.go:332:12: response body must be closed (bodyclose)
internal/upstream/upstream_test.go:357: unnecessary leading newline (whitespace)
internal/upstream/upstream_test.go:409:24: `startRemoteServer` - `serverName` always receives `"Geo primary"` (unparam)
internal/upstream/upstream_test.go:420:23: `startRailsServer` - `railsServerName` always receives `"Local Rails server"` (unparam)
internal/upstream/upstream_test.go:459:2: var-naming: var waitForNextApiPoll should be waitForNextAPIPoll (revive)
Solution
Resolve warnings
Edited by Vasilii Iakliushin