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{ h := New(&Options{
QueueCapacity: 3 * maxBatchSize, QueueCapacity: 3 * maxBatchSize,
RelabelConfigs: []*config.RelabelConfig{ RelabelConfigs: []*config.RelabelConfig{
&config.RelabelConfig{ {
SourceLabels: model.LabelNames{"alertname"}, SourceLabels: model.LabelNames{"alertname"},
Action: "drop", Action: "drop",
Regex: config.MustNewRegexp("drop"), Regex: config.MustNewRegexp("drop"),
}, },
&config.RelabelConfig{ {
SourceLabels: model.LabelNames{"alertname"}, SourceLabels: model.LabelNames{"alertname"},
TargetLabel: "alertname", TargetLabel: "alertname",
Action: "replace", Action: "replace",
@ -221,7 +221,7 @@ func TestHandlerRelabel(t *testing.T) {
}) })
expected := []*model.Alert{ expected := []*model.Alert{
&model.Alert{ {
Labels: model.LabelSet{ Labels: model.LabelSet{
"alertname": "renamed", "alertname": "renamed",
}, },

View File

@ -29,7 +29,7 @@ func TestMain(m *testing.M) {
} }
var portsA = []ContainerPort{ var portsA = []ContainerPort{
ContainerPort{ {
Name: "http", Name: "http",
ContainerPort: 80, ContainerPort: 80,
Protocol: "TCP", Protocol: "TCP",
@ -37,7 +37,7 @@ var portsA = []ContainerPort{
} }
var portsB = []ContainerPort{ var portsB = []ContainerPort{
ContainerPort{ {
Name: "https", Name: "https",
ContainerPort: 443, ContainerPort: 443,
Protocol: "TCP", Protocol: "TCP",
@ -45,7 +45,7 @@ var portsB = []ContainerPort{
} }
var portsNoTcp = []ContainerPort{ var portsNoTcp = []ContainerPort{
ContainerPort{ {
Name: "dns", Name: "dns",
ContainerPort: 53, ContainerPort: 53,
Protocol: "UDP", Protocol: "UDP",
@ -53,12 +53,12 @@ var portsNoTcp = []ContainerPort{
} }
var portsMultiA = []ContainerPort{ var portsMultiA = []ContainerPort{
ContainerPort{ {
Name: "http", Name: "http",
ContainerPort: 80, ContainerPort: 80,
Protocol: "TCP", Protocol: "TCP",
}, },
ContainerPort{ {
Name: "ssh", Name: "ssh",
ContainerPort: 22, ContainerPort: 22,
Protocol: "TCP", Protocol: "TCP",
@ -66,12 +66,12 @@ var portsMultiA = []ContainerPort{
} }
var portsMultiB = []ContainerPort{ var portsMultiB = []ContainerPort{
ContainerPort{ {
Name: "http", Name: "http",
ContainerPort: 80, ContainerPort: 80,
Protocol: "TCP", Protocol: "TCP",
}, },
ContainerPort{ {
Name: "https", Name: "https",
ContainerPort: 443, ContainerPort: 443,
Protocol: "TCP", Protocol: "TCP",
@ -112,7 +112,7 @@ func pod(name string, containers []Container) *Pod {
PodIP: "1.1.1.1", PodIP: "1.1.1.1",
Phase: "Running", Phase: "Running",
Conditions: []PodCondition{ Conditions: []PodCondition{
PodCondition{ {
Type: "Ready", Type: "Ready",
Status: "True", Status: "True",
}, },

View File

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