Overall code formatting via go fmt command

This commit is contained in:
Dark(김성진) 2017-01-24 00:37:19 +09:00
parent 457d22c35c
commit 824029ae54
7 changed files with 24 additions and 24 deletions

View File

@ -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) {

View File

@ -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) {

View File

@ -5,8 +5,8 @@ import (
"sort"
"strings"
"github.com/influxdata/telegraf"
"encoding/json"
"github.com/influxdata/telegraf"
)
const (

View File

@ -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.