diff --git a/align.go b/align.go index f21ce214..6146381a 100644 --- a/align.go +++ b/align.go @@ -25,13 +25,13 @@ func Align(plots [][]*Plot, t draw.Tiles, dc draw.Canvas) [][]draw.Canvas { } // Create the initial tiles. - for j := 0; j < t.Rows; j++ { + for j := range t.Rows { if len(plots[j]) != t.Cols { panic(fmt.Errorf("plot: plots row %d columns (%d) != tiles columns (%d)", j, len(plots[j]), t.Rows)) } o[j] = make([]draw.Canvas, len(plots[j])) - for i := 0; i < t.Cols; i++ { + for i := range t.Cols { o[j][i] = t.At(dc, i, j) } } diff --git a/align_example_test.go b/align_example_test.go index 85456bef..95b1f9d2 100644 --- a/align_example_test.go +++ b/align_example_test.go @@ -18,9 +18,9 @@ import ( func ExampleAlign() { const rows, cols = 4, 3 plots := make([][]*plot.Plot, rows) - for j := 0; j < rows; j++ { + for j := range rows { plots[j] = make([]*plot.Plot, cols) - for i := 0; i < cols; i++ { + for i := range cols { if i == 0 && j == 2 { // This shows what happens when there are nil plots. continue @@ -70,8 +70,8 @@ func ExampleAlign() { } canvases := plot.Align(plots, t, dc) - for j := 0; j < rows; j++ { - for i := 0; i < cols; i++ { + for j := range rows { + for i := range cols { if plots[j][i] != nil { plots[j][i].Draw(canvases[j][i]) } diff --git a/palette/brewer/brewer.go b/palette/brewer/brewer.go index 8c19d71c..02884be7 100644 --- a/palette/brewer/brewer.go +++ b/palette/brewer/brewer.go @@ -125,7 +125,7 @@ func GetPalette(typ PaletteType, name string, colors int) (palette.Palette, erro ) switch typ { case TypeAny: - var pt interface{} + var pt any pt, nameOk = all[name] if !nameOk { break diff --git a/palette/brewer/palettes.go b/palette/brewer/palettes.go index 8ee6cd01..c62ecd80 100644 --- a/palette/brewer/palettes.go +++ b/palette/brewer/palettes.go @@ -4752,7 +4752,7 @@ var ( "YlOrBr": YlOrBr, "YlOrRd": YlOrRd, } - all = map[string]interface{}{ + all = map[string]any{ "BrBG": BrBG, "PiYG": PiYG, "PRGn": PRGn, diff --git a/palette/moreland/example_test.go b/palette/moreland/example_test.go index f400aa13..52187705 100644 --- a/palette/moreland/example_test.go +++ b/palette/moreland/example_test.go @@ -53,8 +53,8 @@ func Example() { YOffset: -50, Data: mat.NewDense(100, 100, nil), } - for i := 0; i < 100; i++ { - for j := 0; j < 100; j++ { + for i := range 100 { + for j := range 100 { x := float64(i-50) / 10 y := float64(j-50) / 10 v := math.Sin(x*x+y*y) / (x*x + y*y) diff --git a/palette/moreland/luminance.go b/palette/moreland/luminance.go index 6688a75a..0baced27 100644 --- a/palette/moreland/luminance.go +++ b/palette/moreland/luminance.go @@ -178,7 +178,7 @@ func (l luminance) Palette(n int) palette.Palette { delta := (l.max - l.min) / float64(n-1) var v float64 c := make([]color.Color, n) - for i := 0; i < n; i++ { + for i := range n { v = l.min + float64(delta*float64(i)) var err error c[i], err = l.At(v) diff --git a/plotter/barchart_example_test.go b/plotter/barchart_example_test.go index 5ea0057c..d73a7a26 100644 --- a/plotter/barchart_example_test.go +++ b/plotter/barchart_example_test.go @@ -165,7 +165,7 @@ func ExampleBarChart_positiveNegative() { data1 := make(plotter.Values, n) data2 := make(plotter.Values, n) net := make(plotter.XYs, n) // net = data1 + data2 - for i := 0; i < n; i++ { + for i := range n { data1[i] = rnd.Float64()*2 - 1 data2[i] = rnd.Float64()*2 - 1 net[i].X = data1[i] + data2[i] diff --git a/plotter/boxplot_example_test.go b/plotter/boxplot_example_test.go index 9f6fa5dc..6a31e6d9 100644 --- a/plotter/boxplot_example_test.go +++ b/plotter/boxplot_example_test.go @@ -24,7 +24,7 @@ func ExampleBoxPlot() { uniform := make(plotter.ValueLabels, n) normal := make(plotter.ValueLabels, n) expon := make(plotter.ValueLabels, n) - for i := 0; i < n; i++ { + for i := range n { uniform[i].Value = rnd.Float64() uniform[i].Label = fmt.Sprintf("%4.4f", uniform[i].Value) normal[i].Value = rnd.NormFloat64() diff --git a/plotter/colorbar.go b/plotter/colorbar.go index b251e98d..26037e1f 100644 --- a/plotter/colorbar.go +++ b/plotter/colorbar.go @@ -62,7 +62,7 @@ func (l *ColorBar) Plot(c draw.Canvas, p *plot.Plot) { Min: image.Point{X: 0, Y: 0}, Max: image.Point{X: 1, Y: colors}, }) - for i := 0; i < colors; i++ { + for i := range colors { color, err := l.ColorMap.At(l.ColorMap.Min() + delta*float64(i)) if err != nil { panic(err) @@ -75,7 +75,7 @@ func (l *ColorBar) Plot(c draw.Canvas, p *plot.Plot) { Min: image.Point{X: 0, Y: 0}, Max: image.Point{X: colors, Y: 1}, }) - for i := 0; i < colors; i++ { + for i := range colors { color, err := l.ColorMap.At(l.ColorMap.Min() + delta*float64(i)) if err != nil { panic(err) diff --git a/plotter/conrec.go b/plotter/conrec.go index f1bd83ee..1be08e67 100644 --- a/plotter/conrec.go +++ b/plotter/conrec.go @@ -76,8 +76,8 @@ func conrec(g GridXYZ, heights []float64, fn conrecLine) { ) c, r := g.Dims() - for i := 0; i < c-1; i++ { - for j := 0; j < r-1; j++ { + for i := range c - 1 { + for j := range r - 1 { dmin := math.Min( math.Min(g.Z(i, j), g.Z(i, j+1)), math.Min(g.Z(i+1, j), g.Z(i+1, j+1)), @@ -92,7 +92,7 @@ func conrec(g GridXYZ, heights []float64, fn conrecLine) { continue } - for k := 0; k < len(heights); k++ { + for k := range heights { if heights[k] < dmin || dmax < heights[k] { continue } diff --git a/plotter/contour.go b/plotter/contour.go index 281929f0..d84a83ba 100644 --- a/plotter/contour.go +++ b/plotter/contour.go @@ -7,6 +7,7 @@ package plotter import ( "image/color" "math" + "slices" "sort" "gonum.org/v1/plot" @@ -64,8 +65,8 @@ func NewContour(g GridXYZ, levels []float64, p palette.Palette) *Contour { default: min, max = math.Inf(1), math.Inf(-1) c, r := g.Dims() - for i := 0; i < c; i++ { - for j := 0; j < r; j++ { + for i := range c { + for j := range r { v := g.Z(i, j) if math.IsNaN(v) { continue @@ -98,8 +99,8 @@ var defaultQuantiles = []float64{0.01, 0.05, 0.25, 0.5, 0.75, 0.95, 0.99} func quantilesR7(g GridXYZ, p []float64) []float64 { c, r := g.Dims() data := make([]float64, 0, c*r) - for i := 0; i < c; i++ { - for j := 0; j < r; j++ { + for i := range c { + for j := range r { if v := g.Z(i, j); !math.IsNaN(v) { data = append(data, v) } @@ -267,8 +268,8 @@ func (h *Contour) DataRange() (xmin, xmax, ymin, ymax float64) { func (h *Contour) GlyphBoxes(plt *plot.Plot) []plot.GlyphBox { c, r := h.GridXYZ.Dims() b := make([]plot.GlyphBox, 0, r*c) - for i := 0; i < c; i++ { - for j := 0; j < r; j++ { + for i := range c { + for j := range r { b = append(b, plot.GlyphBox{ X: plt.X.Norm(h.GridXYZ.X(i)), Y: plt.Y.Norm(h.GridXYZ.Y(j)), @@ -651,7 +652,7 @@ func (c *contour) exciseQuick(conts contourSet) { conts[&contour{ z: c.z, backward: path{wp[i]}, - forward: append(path(nil), wp[i+1:j+1]...), + forward: slices.Clone(wp[i+1 : j+1]), }] = struct{}{} wp = append(wp[:i], wp[j:]...) j = i + 1 diff --git a/plotter/contour_test.go b/plotter/contour_test.go index 995610ea..b412c14e 100644 --- a/plotter/contour_test.go +++ b/plotter/contour_test.go @@ -9,6 +9,7 @@ import ( "fmt" "math" "reflect" + "slices" "sort" "testing" @@ -457,8 +458,8 @@ func TestExciseLoops(t *testing.T) { for i, test := range loopTests { gotSet := make(contourSet) c := &contour{ - backward: append(path(nil), test.c.backward...), - forward: append(path(nil), test.c.forward...), + backward: slices.Clone(test.c.backward), + forward: slices.Clone(test.c.forward), } gotSet[c] = struct{}{} c.exciseLoops(gotSet, quick) diff --git a/plotter/field.go b/plotter/field.go index 389c8043..32ed1858 100644 --- a/plotter/field.go +++ b/plotter/field.go @@ -66,8 +66,8 @@ type Field struct { func NewField(f FieldXY) *Field { max := math.Inf(-1) c, r := f.Dims() - for i := 0; i < c; i++ { - for j := 0; j < r; j++ { + for i := range c { + for j := range r { v := f.Vector(i, j) d := math.Hypot(v.X, v.Y) if math.IsNaN(d) { @@ -93,7 +93,7 @@ func (f *Field) Plot(c draw.Canvas, plt *plot.Plot) { trX, trY := plt.Transforms(&c) cols, rows := f.FieldXY.Dims() - for i := 0; i < cols; i++ { + for i := range cols { var right, left float64 switch i { case 0: @@ -111,7 +111,7 @@ func (f *Field) Plot(c draw.Canvas, plt *plot.Plot) { left = -(f.FieldXY.X(i) - f.FieldXY.X(i-1)) / 2 } - for j := 0; j < rows; j++ { + for j := range rows { var up, down float64 switch j { case 0: @@ -200,8 +200,8 @@ func (f *Field) DataRange() (xmin, xmax, ymin, ymax float64) { func (f *Field) GlyphBoxes(plt *plot.Plot) []plot.GlyphBox { c, r := f.FieldXY.Dims() b := make([]plot.GlyphBox, 0, r*c) - for i := 0; i < c; i++ { - for j := 0; j < r; j++ { + for i := range c { + for j := range r { b = append(b, plot.GlyphBox{ X: plt.X.Norm(f.FieldXY.X(i)), Y: plt.Y.Norm(f.FieldXY.Y(j)), diff --git a/plotter/heat.go b/plotter/heat.go index 2b42486e..311f4dd5 100644 --- a/plotter/heat.go +++ b/plotter/heat.go @@ -81,8 +81,8 @@ func NewHeatMap(g GridXYZ, p palette.Palette) *HeatMap { default: min, max = math.Inf(1), math.Inf(-1) c, r := g.Dims() - for i := 0; i < c; i++ { - for j := 0; j < r; j++ { + for i := range c { + for j := range r { v := g.Z(i, j) if math.IsNaN(v) { continue @@ -120,8 +120,8 @@ func (h *HeatMap) plotRasterized(c draw.Canvas, plt *plot.Plot) { pal := h.Palette.Colors() ps := float64(len(pal)-1) / (h.Max - h.Min) - for i := 0; i < cols; i++ { - for j := 0; j < rows; j++ { + for i := range cols { + for j := range rows { var col color.Color switch v := h.GridXYZ.Z(i, j); { case v < h.Min: @@ -161,7 +161,7 @@ func (h *HeatMap) plotVectorized(c draw.Canvas, plt *plot.Plot) { var pa vg.Path cols, rows := h.GridXYZ.Dims() - for i := 0; i < cols; i++ { + for i := range cols { var right, left float64 switch i { case 0: @@ -179,7 +179,7 @@ func (h *HeatMap) plotVectorized(c draw.Canvas, plt *plot.Plot) { left = -(h.GridXYZ.X(i) - h.GridXYZ.X(i-1)) / 2 } - for j := 0; j < rows; j++ { + for j := range rows { var up, down float64 switch j { case 0: @@ -258,8 +258,8 @@ func (h *HeatMap) DataRange() (xmin, xmax, ymin, ymax float64) { func (h *HeatMap) GlyphBoxes(plt *plot.Plot) []plot.GlyphBox { c, r := h.GridXYZ.Dims() b := make([]plot.GlyphBox, 0, r*c) - for i := 0; i < c; i++ { - for j := 0; j < r; j++ { + for i := range c { + for j := range r { b = append(b, plot.GlyphBox{ X: plt.X.Norm(h.GridXYZ.X(i)), Y: plt.Y.Norm(h.GridXYZ.Y(j)), diff --git a/plotter/histogram.go b/plotter/histogram.go index aafbc807..c444212f 100644 --- a/plotter/histogram.go +++ b/plotter/histogram.go @@ -186,7 +186,7 @@ func binPoints(xys XYer, n int) (bins []HistogramBin, width float64) { xmin, xmax := Range(XValues{xys}) if n <= 0 { m := 0.0 - for i := 0; i < xys.Len(); i++ { + for i := range xys.Len() { _, y := xys.XY(i) m += math.Max(y, 1.0) } @@ -207,7 +207,7 @@ func binPoints(xys XYer, n int) (bins []HistogramBin, width float64) { bins[i].Max = xmin + float64(i+1)*w } - for i := 0; i < xys.Len(); i++ { + for i := range xys.Len() { x, y := xys.XY(i) bin := int((x - xmin) / w) if x == xmax { diff --git a/plotter/histogram_example_test.go b/plotter/histogram_example_test.go index 2765389d..cc233afb 100644 --- a/plotter/histogram_example_test.go +++ b/plotter/histogram_example_test.go @@ -31,7 +31,7 @@ func ExampleHistogram() { n := 10000 vals := make(plotter.Values, n) - for i := 0; i < n; i++ { + for i := range n { vals[i] = rnd.NormFloat64() } diff --git a/plotter/image.go b/plotter/image.go index 66f82679..fb4bb8a2 100644 --- a/plotter/image.go +++ b/plotter/image.go @@ -86,13 +86,13 @@ func (img *Image) transformFor(p *plot.Plot) image.Image { } b := img.img.Bounds() o := image.NewNRGBA64(b) - for c := 0; c < img.cols; c++ { + for c := range img.cols { // Find the equivalent image column after applying axis transforms. cTrans := int(p.X.Norm(img.x(c)) * float64(img.cols)) // Find the equivalent column of the previous image column after applying // axis transforms. cPrevTrans := int(p.X.Norm(img.x(maxInt(c-1, 0))) * float64(img.cols)) - for r := 0; r < img.rows; r++ { + for r := range img.rows { // Find the equivalent image row after applying axis transforms. rTrans := int(p.Y.Norm(img.y(r)) * float64(img.rows)) // Find the equivalent row of the previous image row after applying diff --git a/plotter/plotter.go b/plotter/plotter.go index 9a665f66..7e40cc13 100644 --- a/plotter/plotter.go +++ b/plotter/plotter.go @@ -55,7 +55,7 @@ type Valuer interface { func Range(vs Valuer) (min, max float64) { min = math.Inf(1) max = math.Inf(-1) - for i := 0; i < vs.Len(); i++ { + for i := range vs.Len() { v := vs.Value(i) min = math.Min(min, v) max = math.Max(max, v) @@ -93,7 +93,7 @@ func CopyValues(vs Valuer) (Values, error) { return nil, ErrNoData } cpy := make(Values, vs.Len()) - for i := 0; i < vs.Len(); i++ { + for i := range vs.Len() { cpy[i] = vs.Value(i) if err := CheckFloats(cpy[i]); err != nil { return nil, err diff --git a/plotter/polygon_example_test.go b/plotter/polygon_example_test.go index a6d87bc3..9b1bbc2d 100644 --- a/plotter/polygon_example_test.go +++ b/plotter/polygon_example_test.go @@ -121,9 +121,9 @@ func ExamplePolygon_hexagons() { for i, xmin := range xstart { ymin := ystart[i] x := xmin - for ix := 0; ix < nx; ix++ { + for range nx { y := ymin - for iy := 0; iy < ny; iy++ { + for range ny { var poly *plotter.Polygon poly, err = plotter.NewPolygon(hex(x, y, r)) if err != nil { diff --git a/plotter/quartile_example_test.go b/plotter/quartile_example_test.go index 90b62fa3..65129ac4 100644 --- a/plotter/quartile_example_test.go +++ b/plotter/quartile_example_test.go @@ -22,7 +22,7 @@ func ExampleQuartPlot() { uniform := make(plotter.Values, n) normal := make(plotter.Values, n) expon := make(plotter.Values, n) - for i := 0; i < n; i++ { + for i := range n { uniform[i] = rnd.Float64() normal[i] = rnd.NormFloat64() expon[i] = rnd.ExpFloat64() diff --git a/plotter/rotation_example_test.go b/plotter/rotation_example_test.go index 448d1c7d..b6415b64 100644 --- a/plotter/rotation_example_test.go +++ b/plotter/rotation_example_test.go @@ -24,7 +24,7 @@ func Example_rotation() { // Sin creates a sine curve. sin := func(n int, xmax float64) plotter.XYs { xy := make(plotter.XYs, n) - for i := 0; i < n; i++ { + for i := range n { xy[i].X = xmax / float64(n) * float64(i) xy[i].Y = math.Sin(xy[i].X) * 100 } diff --git a/plotutil/add.go b/plotutil/add.go index c4de4ede..d6d0c96e 100644 --- a/plotutil/add.go +++ b/plotutil/add.go @@ -36,7 +36,7 @@ type item struct { // // If an error occurs then none of the plotters are added // to the plot, and the error is returned. -func AddStackedAreaPlots(plt *plot.Plot, xs plotter.Valuer, vs ...interface{}) error { +func AddStackedAreaPlots(plt *plot.Plot, xs plotter.Valuer, vs ...any) error { var ps []plot.Plotter var names []item name := "" @@ -95,7 +95,7 @@ func AddStackedAreaPlots(plt *plot.Plot, xs plotter.Valuer, vs ...interface{}) e // // If an error occurs then none of the plotters are added // to the plot, and the error is returned. -func AddBoxPlots(plt *plot.Plot, width vg.Length, vs ...interface{}) error { +func AddBoxPlots(plt *plot.Plot, width vg.Length, vs ...any) error { var ps []plot.Plotter var names []string name := "" @@ -133,7 +133,7 @@ func AddBoxPlots(plt *plot.Plot, width vg.Length, vs ...interface{}) error { // // If an error occurs then none of the plotters are added // to the plot, and the error is returned. -func AddScatters(plt *plot.Plot, vs ...interface{}) error { +func AddScatters(plt *plot.Plot, vs ...any) error { var ps []plot.Plotter var items []item name := "" @@ -180,7 +180,7 @@ func AddScatters(plt *plot.Plot, vs ...interface{}) error { // // If an error occurs then none of the plotters are added // to the plot, and the error is returned. -func AddLines(plt *plot.Plot, vs ...interface{}) error { +func AddLines(plt *plot.Plot, vs ...any) error { var ps []plot.Plotter var items []item name := "" @@ -236,7 +236,7 @@ func AddLines(plt *plot.Plot, vs ...interface{}) error { // // If an error occurs then none of the plotters are added // to the plot, and the error is returned. -func AddLinePoints(plt *plot.Plot, vs ...interface{}) error { +func AddLinePoints(plt *plot.Plot, vs ...any) error { var ps []plot.Plotter type item struct { name string @@ -288,7 +288,7 @@ func AddLinePoints(plt *plot.Plot, vs ...interface{}) error { // // If an error occurs then none of the plotters are added // to the plot, and the error is returned. -func AddErrorBars(plt *plot.Plot, vs ...interface{}) error { +func AddErrorBars(plt *plot.Plot, vs ...any) error { var ps []plot.Plotter for i, v := range vs { added := false diff --git a/plotutil/errorpoints.go b/plotutil/errorpoints.go index 0ac8b552..9f4ac23e 100644 --- a/plotutil/errorpoints.go +++ b/plotutil/errorpoints.go @@ -40,7 +40,7 @@ func NewErrorPoints(f func([]float64) (c, l, h float64), pts ...plotter.XYer) (* for i, xy := range pts { xs := make([]float64, xy.Len()) ys := make([]float64, xy.Len()) - for j := 0; j < xy.Len(); j++ { + for j := range xy.Len() { xs[j], ys[j] = xy.XY(j) if err := plotter.CheckFloats(xs[j], ys[j]); err != nil { return nil, err diff --git a/vg/draw/canvas.go b/vg/draw/canvas.go index b62b1439..f1b36703 100644 --- a/vg/draw/canvas.go +++ b/vg/draw/canvas.go @@ -572,7 +572,7 @@ func (c *Canvas) ClipPolygonY(pts []vg.Point) []vg.Point { // and in function. func clipPoly(in func(vg.Point, vg.Point) bool, clip, norm vg.Point, pts []vg.Point) (clipped []vg.Point) { clipped = make([]vg.Point, 0, len(pts)) - for i := 0; i < len(pts); i++ { + for i := range pts { j := i + 1 if i == len(pts)-1 { j = 0 diff --git a/vg/draw/draw_test.go b/vg/draw/draw_test.go index 9fa2f398..67fd4fb2 100644 --- a/vg/draw/draw_test.go +++ b/vg/draw/draw_test.go @@ -113,8 +113,8 @@ func TestTile(t *testing.T) { }, }, } - for j := 0; j < rows; j++ { - for i := 0; i < cols; i++ { + for j := range rows { + for i := range cols { str := "row %d col %d unexpected result: %+v != %+v" tile := tiles.At(c, i, j) if tile.Rectangle != rectangles[j][i] { diff --git a/vg/recorder/recorder.go b/vg/recorder/recorder.go index abafcd6b..bf5292f8 100644 --- a/vg/recorder/recorder.go +++ b/vg/recorder/recorder.go @@ -13,6 +13,7 @@ import ( "image/color" "image/png" "runtime" + "slices" "gonum.org/v1/plot/font" "gonum.org/v1/plot/font/liberation" @@ -150,7 +151,7 @@ type SetLineDash struct { // SetLineDash implements the SetLineDash method of the vg.Canvas interface. func (c *Canvas) SetLineDash(dashes []vg.Length, offs vg.Length) { c.append(&SetLineDash{ - Dashes: append([]vg.Length(nil), dashes...), + Dashes: slices.Clone(dashes), Offsets: offs, }) } @@ -330,7 +331,7 @@ type Stroke struct { // Stroke implements the Stroke method of the vg.Canvas interface. func (c *Canvas) Stroke(path vg.Path) { - c.append(&Stroke{Path: append(vg.Path(nil), path...)}) + c.append(&Stroke{Path: slices.Clone(path)}) } // Call returns the method call that generated the action. @@ -356,7 +357,7 @@ type Fill struct { // Fill implements the Fill method of the vg.Canvas interface. func (c *Canvas) Fill(path vg.Path) { - c.append(&Fill{Path: append(vg.Path(nil), path...)}) + c.append(&Fill{Path: slices.Clone(path)}) } // Call returns the method call that generated the action. diff --git a/vg/vgsvg/vgsvg.go b/vg/vgsvg/vgsvg.go index 6d5447af..168d6239 100644 --- a/vg/vgsvg/vgsvg.go +++ b/vg/vgsvg/vgsvg.go @@ -199,7 +199,7 @@ func (c *Canvas) Push() { } func (c *Canvas) Pop() { - for i := 0; i < c.context().gEnds; i++ { + for range c.context().gEnds { c.svg.Gend() } c.stack = c.stack[:len(c.stack)-1] @@ -556,7 +556,7 @@ func (c *Canvas) WriteTo(w io.Writer) (int64, error) { // Close the groups and svg in the output buffer // so that the Canvas is not closed and can be // used again if needed. - for i := 0; i < c.nEnds(); i++ { + for range c.nEnds() { _, err = fmt.Fprintln(b, "") if err != nil { return b.n, err @@ -616,7 +616,7 @@ func elm(key, def, f string) string { // elmf returns a style element string with the // given key and value. If the value matches // default then the empty string is returned. -func elmf(key, def, f string, vls ...interface{}) string { +func elmf(key, def, f string, vls ...any) string { value := fmt.Sprintf(f, vls...) if value == def { return "" diff --git a/vg/vgtex/canvas.go b/vg/vgtex/canvas.go index 19eb34b7..1468d212 100644 --- a/vg/vgtex/canvas.go +++ b/vg/vgtex/canvas.go @@ -209,7 +209,7 @@ func (c *Canvas) indent(s string) string { return strings.Repeat(s, len(c.stack)) } -func (c *Canvas) wtex(s string, args ...interface{}) { +func (c *Canvas) wtex(s string, args ...any) { fmt.Fprintf(c.buf, c.indent(" ")+s+"\n", args...) }