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

Make services/{admin, httpd, subscriber, udp} golintable #8058

Merged
merged 5 commits into from
Apr 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
- [#8171](https://github.com/influxdata/influxdb/issues/8171): Significantly improve shutdown speed for high cardinality databases.
- [#8177](https://github.com/influxdata/influxdb/issues/8177): Fix racy integration test.
- [#8230](https://github.com/influxdata/influxdb/issues/8230): Prevent overflowing or underflowing during window computation.
- [#8058](https://github.com/influxdata/influxdb/pull/8058): Enabled golint for admin, httpd, subscriber, udp. @karlding

## v1.2.2 [2017-03-14]

Expand Down
1 change: 1 addition & 0 deletions services/admin/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ func (s *Service) Close() error {
return nil
}

// WithLogger sets the logger for the service
func (s *Service) WithLogger(log zap.Logger) {
s.logger = log.With(zap.String("service", "admin"))
}
Expand Down
6 changes: 3 additions & 3 deletions services/httpd/response_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ func (w *csvFormatter) WriteResponse(resp Response) (n int, err error) {
return n, err
}

if out, err := io.WriteString(w, "\n"); err != nil {
out, err := io.WriteString(w, "\n")
if err != nil {
return n, err
} else {
n += out
}
n += out
}
w.statementID = result.StatementID

Expand Down
4 changes: 2 additions & 2 deletions services/subscriber/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func NewHTTP(addr string, timeout time.Duration) (*HTTP, error) {

// NewHTTPS returns a new HTTPS points writer with default options and HTTPS configured.
func NewHTTPS(addr string, timeout time.Duration, unsafeSsl bool, caCerts string) (*HTTP, error) {
tlsConfig, err := createTlsConfig(caCerts)
tlsConfig, err := createTLSConfig(caCerts)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -54,7 +54,7 @@ func (h *HTTP) WritePoints(p *coordinator.WritePointsRequest) (err error) {
return
}

func createTlsConfig(caCerts string) (*tls.Config, error) {
func createTLSConfig(caCerts string) (*tls.Config, error) {
if caCerts == "" {
return nil, nil
}
Expand Down
6 changes: 3 additions & 3 deletions services/udp/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ const (
// Arbitrary, testing indicated that this doesn't typically get over 10
parserChanLen = 1000

// MAX_UDP_PAYLOAD is largest payload size the UDP service will accept.
MAX_UDP_PAYLOAD = 64 * 1024
// MaxUDPPayload is largest payload size the UDP service will accept.
MaxUDPPayload = 64 * 1024
)

// statistics gathered by the UDP package.
Expand Down Expand Up @@ -179,7 +179,7 @@ func (s *Service) writer() {
func (s *Service) serve() {
defer s.wg.Done()

buf := make([]byte, MAX_UDP_PAYLOAD)
buf := make([]byte, MaxUDPPayload)
s.batcher.Start()
for {
select {
Expand Down