all: implement staticcheck suggestions

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-07-19 10:47:17 +02:00
parent 39fd161bea
commit 6ab43aba3e
5 changed files with 2 additions and 7 deletions
-2
View File
@@ -29,8 +29,6 @@ const doubleClickDuration = 200 * time.Millisecond
// Click detects click gestures in the form
// of ClickEvents.
type Click struct {
// state tracks the gesture state.
state ClickState
// clickedAt is the timestamp at which
// the last click occurred.
clickedAt time.Duration
-1
View File
@@ -6,7 +6,6 @@ import (
)
type quadSplitter struct {
verts []byte
bounds f32.Rectangle
contour uint32
d *drawOps
+1 -1
View File
@@ -19,7 +19,7 @@ import (
// use some global variables for benchmarking so as to not pollute
// the reported allocs with allocations that we do not want to count.
var (
c1, c2, c3 = make(chan op.CallOp, 0), make(chan op.CallOp, 0), make(chan op.CallOp, 0)
c1, c2, c3 = make(chan op.CallOp), make(chan op.CallOp), make(chan op.CallOp)
op1, op2, op3 op.Ops
)
+1 -2
View File
@@ -49,8 +49,7 @@ type faceCache struct {
}
func (c *Cache) lookup(font Font) *faceCache {
var f *faceCache
f = c.faceForStyle(font)
f := c.faceForStyle(font)
if f == nil {
font.Typeface = c.def
f = c.faceForStyle(font)
-1
View File
@@ -73,7 +73,6 @@ func clipLoader(ops *op.Ops, startAngle, endAngle, radius float64) {
// Use quadratic beziér curves to approximate a circle arc and
// minimize the error by capping the length of each curve segment.
const maxSegments = 20.
nsegments := math.Round(20 * math.Pi / (endAngle - startAngle))
θ := (endAngle - startAngle) / nsegments