diff --git a/notifier/notifier_test.go b/notifier/notifier_test.go index af87c4085..1d876e50a 100644 --- a/notifier/notifier_test.go +++ b/notifier/notifier_test.go @@ -191,12 +191,12 @@ func TestHandlerRelabel(t *testing.T) { h := New(&Options{ QueueCapacity: 3 * maxBatchSize, RelabelConfigs: []*config.RelabelConfig{ - &config.RelabelConfig{ + { SourceLabels: model.LabelNames{"alertname"}, Action: "drop", Regex: config.MustNewRegexp("drop"), }, - &config.RelabelConfig{ + { SourceLabels: model.LabelNames{"alertname"}, TargetLabel: "alertname", Action: "replace", @@ -221,7 +221,7 @@ func TestHandlerRelabel(t *testing.T) { }) expected := []*model.Alert{ - &model.Alert{ + { Labels: model.LabelSet{ "alertname": "renamed", }, diff --git a/retrieval/discovery/kubernetes/discovery_test.go b/retrieval/discovery/kubernetes/discovery_test.go index fc26b02b4..89ea76d69 100644 --- a/retrieval/discovery/kubernetes/discovery_test.go +++ b/retrieval/discovery/kubernetes/discovery_test.go @@ -29,7 +29,7 @@ func TestMain(m *testing.M) { } var portsA = []ContainerPort{ - ContainerPort{ + { Name: "http", ContainerPort: 80, Protocol: "TCP", @@ -37,7 +37,7 @@ var portsA = []ContainerPort{ } var portsB = []ContainerPort{ - ContainerPort{ + { Name: "https", ContainerPort: 443, Protocol: "TCP", @@ -45,7 +45,7 @@ var portsB = []ContainerPort{ } var portsNoTcp = []ContainerPort{ - ContainerPort{ + { Name: "dns", ContainerPort: 53, Protocol: "UDP", @@ -53,12 +53,12 @@ var portsNoTcp = []ContainerPort{ } var portsMultiA = []ContainerPort{ - ContainerPort{ + { Name: "http", ContainerPort: 80, Protocol: "TCP", }, - ContainerPort{ + { Name: "ssh", ContainerPort: 22, Protocol: "TCP", @@ -66,12 +66,12 @@ var portsMultiA = []ContainerPort{ } var portsMultiB = []ContainerPort{ - ContainerPort{ + { Name: "http", ContainerPort: 80, Protocol: "TCP", }, - ContainerPort{ + { Name: "https", ContainerPort: 443, Protocol: "TCP", @@ -112,7 +112,7 @@ func pod(name string, containers []Container) *Pod { PodIP: "1.1.1.1", Phase: "Running", Conditions: []PodCondition{ - PodCondition{ + { Type: "Ready", Status: "True", }, diff --git a/storage/remote/client.go b/storage/remote/client.go index de7a3100f..93c759fcd 100644 --- a/storage/remote/client.go +++ b/storage/remote/client.go @@ -66,7 +66,7 @@ func (c *Client) Store(samples model.Samples) error { }) } ts.Samples = []*Sample{ - &Sample{ + { Value: float64(s.Value), TimestampMs: int64(s.Timestamp), },