diff --git a/plugins/inputs/http_listener/http_listener.go b/plugins/inputs/http_listener/http_listener.go index a60af1fc3..cbcd0d2ba 100644 --- a/plugins/inputs/http_listener/http_listener.go +++ b/plugins/inputs/http_listener/http_listener.go @@ -17,9 +17,9 @@ import ( ) type HttpListener struct { - ServiceAddress string - ReadTimeout string - WriteTimeout string + ServiceAddress string + ReadTimeout string + WriteTimeout string sync.Mutex @@ -89,9 +89,9 @@ func (t *HttpListener) httpListen() error { writeTimeout, err := strconv.ParseInt(t.WriteTimeout, 10, 32) var server = http.Server{ - Handler: t, - ReadTimeout: time.Duration(readTimeout) * time.Second, - WriteTimeout: time.Duration(writeTimeout) * time.Second, + Handler: t, + ReadTimeout: time.Duration(readTimeout) * time.Second, + WriteTimeout: time.Duration(writeTimeout) * time.Second, } err = server.Serve(t.listener) diff --git a/plugins/inputs/http_listener/http_listener_test.go b/plugins/inputs/http_listener/http_listener_test.go index 1a00b8d2e..d8b543d7e 100644 --- a/plugins/inputs/http_listener/http_listener_test.go +++ b/plugins/inputs/http_listener/http_listener_test.go @@ -7,9 +7,9 @@ import ( "github.com/influxdata/telegraf/plugins/parsers" "github.com/influxdata/telegraf/testutil" + "bytes" "github.com/stretchr/testify/require" "net/http" - "bytes" ) const ( @@ -26,11 +26,11 @@ cpu_load_short,host=server06 value=12.0 1422568543702900257 emptyMsg = "" ) -func newTestHttpListener() (*HttpListener) { +func newTestHttpListener() *HttpListener { listener := &HttpListener{ ServiceAddress: ":8186", - ReadTimeout: "10", - WriteTimeout: "10", + ReadTimeout: "10", + WriteTimeout: "10", } return listener } @@ -125,4 +125,3 @@ func TestQueryHTTP(t *testing.T) { require.NoError(t, err) require.EqualValues(t, 200, resp.StatusCode) } -