Mercurial > gemma
changeset 1329:ea2143adc6d3
Named method recievers consistently to make golint happy.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Sun, 25 Nov 2018 17:05:19 +0100 |
parents | d753ce6cf588 |
children | 785f14264426 |
files | pkg/auth/session.go pkg/octree/vertex.go |
diffstat | 2 files changed, 20 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/pkg/auth/session.go Sun Nov 25 16:26:41 2018 +0100 +++ b/pkg/auth/session.go Sun Nov 25 17:05:19 2018 +0100 @@ -124,16 +124,16 @@ return nil } -func (c *Session) touch() { - c.mu.Lock() - c.access = time.Now() - c.mu.Unlock() +func (s *Session) touch() { + s.mu.Lock() + s.access = time.Now() + s.mu.Unlock() } -func (c *Session) last() time.Time { - c.mu.Lock() - access := c.access - c.mu.Unlock() +func (s *Session) last() time.Time { + s.mu.Lock() + access := s.access + s.mu.Unlock() return access }
--- a/pkg/octree/vertex.go Sun Nov 25 16:26:41 2018 +0100 +++ b/pkg/octree/vertex.go Sun Nov 25 17:05:19 2018 +0100 @@ -110,8 +110,8 @@ } } -func (a Vertex) Less(b Vertex) bool { - return a.X < b.X || a.Y < b.Y || a.Z < b.Z +func (v Vertex) Less(w Vertex) bool { + return v.X < w.X || v.Y < w.Y || v.Z < w.Z } func NewLine(p1, p2 Vertex) Line { @@ -537,26 +537,26 @@ return false } -func (a Vertex) Cross(b Vertex) Vertex { +func (v Vertex) Cross(w Vertex) Vertex { return Vertex{ - a.Y*b.Z - a.Z*b.Y, - a.Z*b.X - a.X*b.Z, - a.X*b.Y - a.Y*b.X, + v.Y*w.Z - v.Z*w.Y, + v.Z*w.X - v.X*w.Z, + v.X*w.Y - v.Y*w.X, } } -func (p1 Plane2D) Intersection(p2 Plane2D) (float64, float64, bool) { +func (p Plane2D) Intersection(o Plane2D) (float64, float64, bool) { - u1 := Vertex{p1.A, p1.B, p1.C} - u2 := Vertex{p2.A, p2.B, p2.C} + u1 := Vertex{p.A, p.B, p.C} + u2 := Vertex{o.A, o.B, o.C} - p := u1.Cross(u2) + plane := u1.Cross(u2) - if p.Z == 0 { + if plane.Z == 0 { return 0, 0, false } - return p.X / p.Z, p.Y / p.Z, true + return plane.X / plane.Z, plane.Y / plane.Z, true } type VerticalLine struct {