Skip to content

Commit

Permalink
Simplify struct initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
grobie committed Sep 15, 2016
1 parent 0385567 commit 8f3b62b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions notifier/notifier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -221,7 +221,7 @@ func TestHandlerRelabel(t *testing.T) {
})

expected := []*model.Alert{
&model.Alert{
{
Labels: model.LabelSet{
"alertname": "renamed",
},
Expand Down
16 changes: 8 additions & 8 deletions retrieval/discovery/kubernetes/discovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,49 +29,49 @@ func TestMain(m *testing.M) {
}

var portsA = []ContainerPort{
ContainerPort{
{
Name: "http",
ContainerPort: 80,
Protocol: "TCP",
},
}

var portsB = []ContainerPort{
ContainerPort{
{
Name: "https",
ContainerPort: 443,
Protocol: "TCP",
},
}

var portsNoTcp = []ContainerPort{
ContainerPort{
{
Name: "dns",
ContainerPort: 53,
Protocol: "UDP",
},
}

var portsMultiA = []ContainerPort{
ContainerPort{
{
Name: "http",
ContainerPort: 80,
Protocol: "TCP",
},
ContainerPort{
{
Name: "ssh",
ContainerPort: 22,
Protocol: "TCP",
},
}

var portsMultiB = []ContainerPort{
ContainerPort{
{
Name: "http",
ContainerPort: 80,
Protocol: "TCP",
},
ContainerPort{
{
Name: "https",
ContainerPort: 443,
Protocol: "TCP",
Expand Down Expand Up @@ -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",
},
Expand Down
2 changes: 1 addition & 1 deletion storage/remote/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (c *Client) Store(samples model.Samples) error {
})
}
ts.Samples = []*Sample{
&Sample{
{
Value: float64(s.Value),
TimestampMs: int64(s.Timestamp),
},
Expand Down

0 comments on commit 8f3b62b

Please sign in to comment.