Skip to content

Commit db3dfe8

Browse files
committed
fix: gofumpt
Signed-off-by: Carlos Alexandro Becker <[email protected]>
1 parent 7d8fe81 commit db3dfe8

File tree

8 files changed

+20
-12
lines changed

8 files changed

+20
-12
lines changed

controller/helpers.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ package controller
22

33
import (
44
"fmt"
5-
"github.com/gorilla/mux"
65
"net/http"
76
"regexp"
87
"time"
8+
9+
"github.com/gorilla/mux"
910
)
1011

1112
const (

controller/repositories.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ package controller
22

33
import (
44
"fmt"
5+
"html/template"
6+
"io/fs"
7+
"net/http"
8+
59
"github.com/caarlos0/httperr"
610
"github.com/caarlos0/starcharts/internal/cache"
711
"github.com/caarlos0/starcharts/internal/github"
812
"github.com/gorilla/mux"
9-
"html/template"
10-
"io/fs"
11-
"net/http"
1213
)
1314

1415
const (

internal/chart/font.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ package chart
22

33
import (
44
_ "embed"
5-
"github.com/golang/freetype/truetype"
65
"sync"
6+
7+
"github.com/golang/freetype/truetype"
78
)
89

910
var (

internal/chart/helpers.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ package chart
22

33
import (
44
"fmt"
5+
"time"
6+
57
"github.com/caarlos0/starcharts/internal/chart/svg"
68
"github.com/golang/freetype/truetype"
79
"golang.org/x/image/font"
8-
"time"
910
)
1011

1112
func measureText(body string, size float64) Box {

internal/chart/render.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ func (c *Chart) Render(w io.Writer) {
5757
}
5858

5959
func (c *Chart) getRanges(canvas *Box) (*Range, *Range) {
60-
var minX, maxX = math.MaxFloat64, -math.MaxFloat64
61-
var minY, maxY = math.MaxFloat64, -math.MaxFloat64
60+
minX, maxX := math.MaxFloat64, -math.MaxFloat64
61+
minY, maxY := math.MaxFloat64, -math.MaxFloat64
6262

6363
seriesLength := c.Series.Len()
6464
for index := 0; index < seriesLength; index++ {

internal/chart/series.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
package chart
22

33
import (
4-
"github.com/caarlos0/starcharts/internal/chart/svg"
54
"io"
65
"time"
6+
7+
"github.com/caarlos0/starcharts/internal/chart/svg"
78
)
89

910
type Series struct {
@@ -16,6 +17,7 @@ type Series struct {
1617
func (ts *Series) Len() int {
1718
return len(ts.XValues)
1819
}
20+
1921
func (ts *Series) GetValues(index int) (x, y float64) {
2022
x = toFloat64(ts.XValues[index])
2123
y = ts.YValues[index]

internal/chart/x_axis.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
package chart
22

33
import (
4-
"github.com/caarlos0/starcharts/internal/chart/svg"
54
"io"
65
"math"
6+
7+
"github.com/caarlos0/starcharts/internal/chart/svg"
78
)
89

910
type XAxis struct {
@@ -15,7 +16,7 @@ type XAxis struct {
1516
func (xa *XAxis) Measure(canvas *Box, ra *Range, ticks []Tick) *Box {
1617
var ltx, rtx int
1718
var tx, ty int
18-
var left, right, bottom = math.MaxInt32, 0, 0
19+
left, right, bottom := math.MaxInt32, 0, 0
1920
for _, t := range ticks {
2021
v := t.Value
2122
tb := measureText(t.Label, AxisFontSize)

internal/chart/y_axis.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
package chart
22

33
import (
4-
"github.com/caarlos0/starcharts/internal/chart/svg"
54
"io"
65
"math"
6+
7+
"github.com/caarlos0/starcharts/internal/chart/svg"
78
)
89

910
type YAxis struct {

0 commit comments

Comments
 (0)