Overall code formatting via go fmt command
This commit is contained in:
parent
457d22c35c
commit
824029ae54
|
@ -11,9 +11,9 @@ import (
|
|||
"github.com/influxdata/telegraf"
|
||||
"github.com/influxdata/telegraf/metric"
|
||||
|
||||
"github.com/influxdata/telegraf/plugins/serializers/graphite"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"github.com/influxdata/telegraf/plugins/serializers/graphite"
|
||||
)
|
||||
|
||||
func TestGraphiteError(t *testing.T) {
|
||||
|
|
|
@ -10,8 +10,8 @@ import (
|
|||
|
||||
"github.com/influxdata/telegraf"
|
||||
"github.com/influxdata/telegraf/metric"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/influxdata/telegraf/plugins/serializers/graphite"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestWrite(t *testing.T) {
|
||||
|
|
|
@ -5,8 +5,8 @@ import (
|
|||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/influxdata/telegraf"
|
||||
"encoding/json"
|
||||
"github.com/influxdata/telegraf"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -490,14 +490,14 @@ func TestSerializerWithJsonProtocol2(t *testing.T) {
|
|||
// then
|
||||
actualS := string(buf)
|
||||
|
||||
expS := fmt.Sprintf("[" +
|
||||
"{\"path\":\"localhost.cpu0.us-west-2.cpu.usage_idle\",\"value\":\"91.5\",\"timestamp\":\"%d\"}," +
|
||||
"{\"path\":\"localhost.cpu0.us-west-2.cpu.usage_busy\",\"value\":\"8.5\",\"timestamp\":\"%d\"}" +
|
||||
expS := fmt.Sprintf("["+
|
||||
"{\"path\":\"localhost.cpu0.us-west-2.cpu.usage_idle\",\"value\":\"91.5\",\"timestamp\":\"%d\"},"+
|
||||
"{\"path\":\"localhost.cpu0.us-west-2.cpu.usage_busy\",\"value\":\"8.5\",\"timestamp\":\"%d\"}"+
|
||||
"]", now.Unix(), now.Unix())
|
||||
|
||||
reorderedExpS := fmt.Sprintf("[" +
|
||||
"{\"path\":\"localhost.cpu0.us-west-2.cpu.usage_busy\",\"value\":\"8.5\",\"timestamp\":\"%d\"}," +
|
||||
"{\"path\":\"localhost.cpu0.us-west-2.cpu.usage_idle\",\"value\":\"91.5\",\"timestamp\":\"%d\"}" +
|
||||
reorderedExpS := fmt.Sprintf("["+
|
||||
"{\"path\":\"localhost.cpu0.us-west-2.cpu.usage_busy\",\"value\":\"8.5\",\"timestamp\":\"%d\"},"+
|
||||
"{\"path\":\"localhost.cpu0.us-west-2.cpu.usage_idle\",\"value\":\"91.5\",\"timestamp\":\"%d\"}"+
|
||||
"]", now.Unix(), now.Unix())
|
||||
|
||||
// serialize function uses internally map. result is not same everytime because map is not guaranteed key ordering.
|
||||
|
|
Loading…
Reference in New Issue