Simplify struct initialization

pull/1994/head
Tobias Schmidt 2016-09-14 23:13:27 -04:00
parent 03855679a1
commit 8f3b62bfe4
3 changed files with 12 additions and 12 deletions

View File

@ -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",
},

View File

@ -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",
},

View File

@ -66,7 +66,7 @@ func (c *Client) Store(samples model.Samples) error {
})
}
ts.Samples = []*Sample{
&Sample{
{
Value: float64(s.Value),
TimestampMs: int64(s.Timestamp),
},