aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2021-08-09 13:04:45 +0200
committerMartin Polden <mpolden@mpolden.no>2021-08-09 13:04:45 +0200
commitbee59bca7fcf9999889024326968044d91875460 (patch)
tree56aea17302f29a950e2a642111b9c916bf3ae39c
parent2969f37b3a4cbe41acf8c9b252a0feb30ebd7844 (diff)
all: Fix staticcheck warnings
-rw-r--r--cache/cache.go4
-rw-r--r--http/http.go2
2 files changed, 3 insertions, 3 deletions
diff --git a/cache/cache.go b/cache/cache.go
index 32ec054..8079557 100644
--- a/cache/cache.go
+++ b/cache/cache.go
@@ -24,8 +24,8 @@ func New(expiryInterval time.Duration) *Cache {
entries := make(map[string]entry)
c := &Cache{entries: entries, now: time.Now}
go func() {
- select {
- case <-time.After(expiryInterval):
+ for {
+ time.Sleep(expiryInterval)
c.evictExpired()
}
}()
diff --git a/http/http.go b/http/http.go
index 0f3ab88..b69accb 100644
--- a/http/http.go
+++ b/http/http.go
@@ -159,7 +159,7 @@ func (s *Server) DepartureHandler(w http.ResponseWriter, r *http.Request) (inter
Message: "Invalid nodeID",
}
}
- busStops, hit, err := s.getBusStops(urlPrefix(r))
+ busStops, _, err := s.getBusStops(urlPrefix(r))
if err != nil {
return nil, &Error{
err: err,