Skip to content

Commit

Permalink
golint fix
Browse files Browse the repository at this point in the history
Signed-off-by: LiZhenCheng9527 <[email protected]>
  • Loading branch information
LiZhenCheng9527 committed Jul 29, 2024
1 parent dbbe6a1 commit cc6be1e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/controller/telemetry/metric_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/prometheus/client_golang/prometheus"
dto "github.com/prometheus/client_model/go"
"github.com/stretchr/testify/assert"

"kmesh.net/kmesh/api/v2/workloadapi"
"kmesh.net/kmesh/pkg/controller/workload/cache"
)
Expand Down Expand Up @@ -253,7 +254,7 @@ func TestBuildMetricsToPrometheus(t *testing.T) {
}
}

func TestbuildWorkloadMetric(t *testing.T) {
func TestBuildWorkloadMetric(t *testing.T) {
type args struct {
dstWorkload *workloadapi.Workload
srcWorkload *workloadapi.Workload
Expand Down Expand Up @@ -318,7 +319,7 @@ func TestbuildWorkloadMetric(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
actualLabels := buildWorkloadMetric(tt.args.dstWorkload, tt.args.srcWorkload)
expectMap := struct2map(tt.want)
actualMap := struct2map(&actualLabels)
actualMap := struct2map(actualLabels)
assert.Equal(t, expectMap, actualMap)
})
}
Expand Down Expand Up @@ -501,7 +502,7 @@ func TestBuildServiceMetric(t *testing.T) {
{192, 168, 224, 22},
},
Services: map[string]*workloadapi.PortList{
"kmesh-system/kmesh.kmesh-system.svc.cluster.local": &workloadapi.PortList{
"kmesh-system/kmesh.kmesh-system.svc.cluster.local": {
Ports: []*workloadapi.Port{
{
TargetPort: 80,
Expand Down

0 comments on commit cc6be1e

Please sign in to comment.