diff --git a/annotation_series_test.go b/annotation_series_test.go index 00b6572..d25f4e9 100644 --- a/annotation_series_test.go +++ b/annotation_series_test.go @@ -16,10 +16,10 @@ func TestAnnotationSeriesMeasure(t *testing.T) { Show: true, }, Annotations: []Annotation{ - Annotation{X: 1.0, Y: 1.0, Label: "1.0"}, - Annotation{X: 2.0, Y: 2.0, Label: "2.0"}, - Annotation{X: 3.0, Y: 3.0, Label: "3.0"}, - Annotation{X: 4.0, Y: 4.0, Label: "4.0"}, + {X: 1.0, Y: 1.0, Label: "1.0"}, + {X: 2.0, Y: 2.0, Label: "2.0"}, + {X: 3.0, Y: 3.0, Label: "3.0"}, + {X: 4.0, Y: 4.0, Label: "4.0"}, }, } @@ -69,10 +69,10 @@ func TestAnnotationSeriesRender(t *testing.T) { StrokeColor: drawing.ColorBlack, }, Annotations: []Annotation{ - Annotation{X: 1.0, Y: 1.0, Label: "1.0"}, - Annotation{X: 2.0, Y: 2.0, Label: "2.0"}, - Annotation{X: 3.0, Y: 3.0, Label: "3.0"}, - Annotation{X: 4.0, Y: 4.0, Label: "4.0"}, + {X: 1.0, Y: 1.0, Label: "1.0"}, + {X: 2.0, Y: 2.0, Label: "2.0"}, + {X: 3.0, Y: 3.0, Label: "3.0"}, + {X: 4.0, Y: 4.0, Label: "4.0"}, }, } diff --git a/testserver/main.go b/testserver/main.go index de7c50c..4002b38 100644 --- a/testserver/main.go +++ b/testserver/main.go @@ -52,7 +52,7 @@ func chartHandler(rc *web.RequestContext) web.ControllerResult { StrokeColor: chart.GetDefaultSeriesStrokeColor(0), }, Annotations: []chart.Annotation{ - chart.Annotation{ + { X: float64(s1x[len(s1x)-1].Unix()), Y: s1y[len(s1y)-1], Label: fmt.Sprintf("%s - %s", "test", chart.FloatValueFormatter(s1y[len(s1y)-1])), diff --git a/xaxis_test.go b/xaxis_test.go index a558d48..933388b 100644 --- a/xaxis_test.go +++ b/xaxis_test.go @@ -76,7 +76,7 @@ func TestXAxisGetTicksWithUserDefaults(t *testing.T) { assert.Nil(err) xa := XAxis{ - Ticks: []Tick{Tick{Value: 1.0, Label: "1.0"}}, + Ticks: []Tick{{Value: 1.0, Label: "1.0"}}, } xr := Range{Min: 10, Max: 100, Domain: 1024} styleDefaults := Style{ diff --git a/yaxis_test.go b/yaxis_test.go index de0b032..fdd7a72 100644 --- a/yaxis_test.go +++ b/yaxis_test.go @@ -76,7 +76,7 @@ func TestYAxisGetTicksWithUserDefaults(t *testing.T) { assert.Nil(err) ya := YAxis{ - Ticks: []Tick{Tick{Value: 1.0, Label: "1.0"}}, + Ticks: []Tick{{Value: 1.0, Label: "1.0"}}, } yr := Range{Min: 10, Max: 100, Domain: 1024} styleDefaults := Style{