Skip to content

Commit

Permalink
Enable stylecheck linter and fix errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
sengi committed Aug 6, 2023
1 parent dc13c65 commit 93ad275
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,15 @@ linters:
- promlinter
- reassign
- revive
- stylecheck
- tenv
- tparallel
- unconvert
- usestdlibvars
- wastedassign
- zerologlint
linters-settings:
stylecheck:
dot-import-whitelist:
- github.com/onsi/ginkgo/v2
- github.com/onsi/gomega
4 changes: 2 additions & 2 deletions lib/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ type Router struct {

type Options struct {
MongoURL string
MongoDbName string
MongoDBName string
MongoPollInterval time.Duration
BackendConnTimeout time.Duration
BackendHeaderTimeout time.Duration
Expand Down Expand Up @@ -193,7 +193,7 @@ func (rt *Router) pollAndReload() {

if rt.shouldReload(currentMongoInstance) {
logDebug("router: updates found")
rt.reloadRoutes(sess.DB(rt.opts.MongoDbName), currentMongoInstance.Optime)
rt.reloadRoutes(sess.DB(rt.opts.MongoDBName), currentMongoInstance.Optime)
} else {
logDebug("router: no updates found")
}
Expand Down
2 changes: 1 addition & 1 deletion logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func openWriter(output interface{}) (w io.Writer, err error) {
}
}
default:
return nil, fmt.Errorf("Invalid output type %T(%v)", output, output)
return nil, fmt.Errorf("invalid output type %T(%v)", output, output)
}
return
}
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func main() {
pubAddr = getenv("ROUTER_PUBADDR", ":8080")
apiAddr = getenv("ROUTER_APIADDR", ":8081")
mongoURL = getenv("ROUTER_MONGO_URL", "127.0.0.1")
mongoDbName = getenv("ROUTER_MONGO_DB", "router")
mongoDBName = getenv("ROUTER_MONGO_DB", "router")
mongoPollInterval = getenvDuration("ROUTER_MONGO_POLL_INTERVAL", "2s")
errorLogFile = getenv("ROUTER_ERROR_LOG", "STDERR")
tlsSkipVerify = os.Getenv("ROUTER_TLS_SKIP_VERIFY") != ""
Expand All @@ -109,7 +109,7 @@ func main() {

rout, err := router.NewRouter(router.Options{
MongoURL: mongoURL,
MongoDbName: mongoDbName,
MongoDBName: mongoDBName,
MongoPollInterval: mongoPollInterval,
BackendConnTimeout: beConnTimeout,
BackendHeaderTimeout: beHeaderTimeout,
Expand Down

0 comments on commit 93ad275

Please sign in to comment.