Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix staticcheck errors #3124

Closed
SuperQ opened this Issue Aug 28, 2017 · 1 comment

Comments

Projects
None yet
1 participant
@SuperQ
Copy link
Member

SuperQ commented Aug 28, 2017

I ran the staticcheck tool and discovered a few issues. It would be nice to enable this in the Makefile like we do with several of the exporters.

Here's the current list of issues:

cmd/prometheus/main.go:233:15: the channel used with signal.Notify should be buffered (SA1017)
discovery/kubernetes/node.go:191:46: api.NodeLegacyHostIP is deprecated: NodeLegacyHostIP will be removed in 1.7.  (SA1019)
documentation/examples/remote_storage/remote_storage_adapter/main.go:97:33: prometheus.Handler is deprecated: Please note the issues described in the doc comment of InstrumentHandler. You might want to consider using promhttp.Handler instead (which is not instrumented).  (SA1019)
retrieval/target_test.go:133:64: cutset contains duplicate characters (SA1024)
storage/local/codable/codable.go:69:13: argument should be one word large or less to avoid allocations (SA6002)
storage/local/mapper_test.go:65:10: this value of err is never used (SA4006)
storage/local/persistence.go:465:27: os.SEEK_CUR is deprecated: Use io.SeekStart, io.SeekCurrent, and io.SeekEnd.  (SA1019)
storage/local/persistence.go:494:16: argument should be one word large or less to avoid allocations (SA6002)
storage/local/persistence.go:501:68: os.SEEK_SET is deprecated: Use io.SeekStart, io.SeekCurrent, and io.SeekEnd.  (SA1019)
storage/local/persistence.go:564:71: os.SEEK_SET is deprecated: Use io.SeekStart, io.SeekCurrent, and io.SeekEnd.  (SA1019)
storage/local/persistence.go:817:51: os.SEEK_SET is deprecated: Use io.SeekStart, io.SeekCurrent, and io.SeekEnd.  (SA1019)
storage/local/persistence.go:974:52: os.SEEK_SET is deprecated: Use io.SeekStart, io.SeekCurrent, and io.SeekEnd.  (SA1019)
storage/local/persistence.go:1010:43: os.SEEK_SET is deprecated: Use io.SeekStart, io.SeekCurrent, and io.SeekEnd.  (SA1019)
storage/local/persistence.go:1036:35: os.SEEK_CUR is deprecated: Use io.SeekStart, io.SeekCurrent, and io.SeekEnd.  (SA1019)
storage/local/persistence.go:1663:16: argument should be one word large or less to avoid allocations (SA6002)
storage/local/persistence_test.go:138:21: this value of err is never used (SA4006)
storage/local/storage_test.go:1423:2: this value of series is never used (SA4006)
storage/remote/client_test.go:67:6: this value of err is never used (SA4006)
storage/remote/queue_manager.go:252:21: using time.Tick leaks the underlying ticker, consider using it only in endless functions, tests and the main package, and use time.NewTicker here (SA1015)
web/web.go:186:12: prometheus.InstrumentHandlerFunc is deprecated: InstrumentHandlerFunc is deprecated for the same reasons as InstrumentHandler is.  (SA1019)
web/web.go:204:35: prometheus.Handler is deprecated: Please note the issues described in the doc comment of InstrumentHandler. You might want to consider using promhttp.Handler instead (which is not instrumented).  (SA1019)
@lock

This comment has been minimized.

Copy link

lock bot commented Mar 23, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 23, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.