cleanup: go vet and golint run (#736)
* cleanup: go vet and golint run Various cleanups trickered by go vet and golint. * Fix tests and lowercase all errors Lowercase all errors, some tests in kubernetes use errors from kubernetes which do start with a capital letter.
This commit is contained in:
parent
5c10eba31c
commit
e49ca86ce4
21 changed files with 64 additions and 62 deletions
3
middleware/cache/freq/freq.go
vendored
3
middleware/cache/freq/freq.go
vendored
|
@ -7,6 +7,7 @@ import (
|
|||
"time"
|
||||
)
|
||||
|
||||
// Freq tracks the frequence of things.
|
||||
type Freq struct {
|
||||
// Last time we saw a query for this element.
|
||||
last time.Time
|
||||
|
@ -21,7 +22,7 @@ func New(t time.Time) *Freq {
|
|||
return &Freq{last: t, hits: 0}
|
||||
}
|
||||
|
||||
// Updates updates the number of hits. Last time seen will be set to now.
|
||||
// Update updates the number of hits. Last time seen will be set to now.
|
||||
// If the last time we've seen this entity is within now - d, we increment hits, otherwise
|
||||
// we reset hits to 1. It returns the number of hits.
|
||||
func (f *Freq) Update(d time.Duration, now time.Time) int {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue