resources: Fix golint issues

Including a trick to get the golinter to allow our compact code!
This commit is contained in:
James Shubin
2017-06-08 04:13:41 -04:00
parent 6b489f71a1
commit a8bbb22fe8
8 changed files with 102 additions and 101 deletions

View File

@@ -529,8 +529,9 @@ func (obj *EmbdEtcd) CtxError(ctx context.Context, err error) (context.Context,
if obj.ctxErr != nil { // stop on permanent error
return ctx, obj.ctxErr
}
const ctxErr = "ctxErr"
const ctxIter = "ctxIter"
type ctxKey string // use a non-basic type as ctx key (str can conflict)
const ctxErr ctxKey = "ctxErr"
const ctxIter ctxKey = "ctxIter"
expBackoff := func(tmin, texp, iter, tmax int) time.Duration {
// https://en.wikipedia.org/wiki/Exponential_backoff
// tmin <= texp^iter - 1 <= tmax // TODO: check my math