Update lint (#44)

* Reduce complexity of SignatureCollector.Accept

* Add stylecheck linter, and lint accordingly

* Rephrase some comments

* godot - Top level comments should end with a dot.

* nestif - Reduce nested complexity of code

* Review changes

Co-authored-by: Aron Wussler <aron@wussler.it>
This commit is contained in:
zugzwang 2020-04-28 13:55:36 +02:00 committed by GitHub
parent 222decb919
commit ac8a49c114
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 252 additions and 265 deletions

View file

@ -5,25 +5,25 @@ import (
"time"
)
// UpdateTime updates cached time
// UpdateTime updates cached time.
func UpdateTime(newTime int64) {
pgp.latestServerTime = newTime
pgp.latestClientTime = time.Now()
}
// GetUnixTime gets latest cached time
// GetUnixTime gets latest cached time.
func GetUnixTime() int64 {
return getNow().Unix()
}
// GetTime gets latest cached time
// GetTime gets latest cached time.
func GetTime() time.Time {
return getNow()
}
// ----- INTERNAL FUNCTIONS -----
// getNow returns current time
// getNow returns current time.
func getNow() time.Time {
extrapolate, err := getDiff()
@ -43,7 +43,7 @@ func getDiff() (int64, error) {
return 0, errors.New("gopenpgp: latest server time not available")
}
// getTimeGenerator Returns a time generator function
// getTimeGenerator Returns a time generator function.
func getTimeGenerator() func() time.Time {
return getNow
}