apply review

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
This commit is contained in:
Augustin Husson 2018-09-18 11:08:38 +02:00
parent e03869de76
commit 3c0b130e5e
2 changed files with 9 additions and 7 deletions

View File

@ -18,14 +18,15 @@ import (
"context" "context"
"encoding/json" "encoding/json"
"fmt" "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" "io/ioutil"
"os" "os"
"path/filepath" "path/filepath"
"reflect" "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 { type customSD struct {

View File

@ -14,10 +14,11 @@
package adapter package adapter
import ( import (
"github.com/prometheus/common/model"
"github.com/prometheus/prometheus/discovery/targetgroup"
"reflect" "reflect"
"testing" "testing"
"github.com/prometheus/common/model"
"github.com/prometheus/prometheus/discovery/targetgroup"
) )
// TestGenerateTargetGroups checks that the target is correctly generated. // TestGenerateTargetGroups checks that the target is correctly generated.
@ -141,7 +142,7 @@ func TestGenerateTargetGroups(t *testing.T) {
result := generateTargetGroups(testCase.targetGroup) result := generateTargetGroups(testCase.targetGroup)
if !reflect.DeepEqual(result, testCase.expectedCustomSD) { 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, testCase.title,
result, result,
testCase.expectedCustomSD) testCase.expectedCustomSD)