mirror of
				https://github.com/coredns/coredns.git
				synced 2025-10-31 02:03:20 -04:00 
			
		
		
		
	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:
		
							
								
								
									
										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 { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user