From 3c0b130e5e3918d90e86de17dd056b17482edf86 Mon Sep 17 00:00:00 2001 From: Augustin Husson Date: Tue, 18 Sep 2018 11:08:38 +0200 Subject: [PATCH] apply review Signed-off-by: Augustin Husson --- documentation/examples/custom-sd/adapter/adapter.go | 9 +++++---- documentation/examples/custom-sd/adapter/adapter_test.go | 7 ++++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/documentation/examples/custom-sd/adapter/adapter.go b/documentation/examples/custom-sd/adapter/adapter.go index 39cfea289..048a7be34 100644 --- a/documentation/examples/custom-sd/adapter/adapter.go +++ b/documentation/examples/custom-sd/adapter/adapter.go @@ -18,14 +18,15 @@ import ( "context" "encoding/json" "fmt" - "github.com/go-kit/kit/log" - "github.com/go-kit/kit/log/level" - "github.com/prometheus/prometheus/discovery" - "github.com/prometheus/prometheus/discovery/targetgroup" "io/ioutil" "os" "path/filepath" "reflect" + + "github.com/go-kit/kit/log" + "github.com/go-kit/kit/log/level" + "github.com/prometheus/prometheus/discovery" + "github.com/prometheus/prometheus/discovery/targetgroup" ) type customSD struct { diff --git a/documentation/examples/custom-sd/adapter/adapter_test.go b/documentation/examples/custom-sd/adapter/adapter_test.go index 291f2e082..563e1c108 100644 --- a/documentation/examples/custom-sd/adapter/adapter_test.go +++ b/documentation/examples/custom-sd/adapter/adapter_test.go @@ -14,10 +14,11 @@ package adapter import ( - "github.com/prometheus/common/model" - "github.com/prometheus/prometheus/discovery/targetgroup" "reflect" "testing" + + "github.com/prometheus/common/model" + "github.com/prometheus/prometheus/discovery/targetgroup" ) // TestGenerateTargetGroups checks that the target is correctly generated. @@ -141,7 +142,7 @@ func TestGenerateTargetGroups(t *testing.T) { result := generateTargetGroups(testCase.targetGroup) if !reflect.DeepEqual(result, testCase.expectedCustomSD) { - t.Errorf("%v :\nresult produced %v\nmismatch the expected customSD: %v", + t.Errorf("%q failed\ngot: %#v\nexpected: %v", testCase.title, result, testCase.expectedCustomSD)