Fix golint failures

* Fix golint fails based on the original work from  the user u5surf

* Skip installing Docker as CDP now have one pre-installed (repairs builds on CDP)
This commit is contained in:
zerg-junior
2019-01-08 13:04:48 +01:00
committed by GitHub
parent f7058c754d
commit 4b5d3cd121
18 changed files with 61 additions and 23 deletions
+4
View File
@@ -19,6 +19,7 @@ type fieldInfo struct {
Field reflect.Value
}
// StringTemplate is a convenience alias
type StringTemplate string
func decoderFrom(field reflect.Value) (d decoder) {
@@ -221,12 +222,14 @@ func getMapPairsFromString(value string) (pairs []string, err error) {
return
}
// Decode cast value to StringTemplate
func (f *StringTemplate) Decode(value string) error {
*f = StringTemplate(value)
return nil
}
// Format formatted string from StringTemplate
func (f *StringTemplate) Format(a ...string) string {
res := string(*f)
@@ -237,6 +240,7 @@ func (f *StringTemplate) Format(a ...string) string {
return res
}
// MarshalJSON converts a StringTemplate to byte slice
func (f StringTemplate) MarshalJSON() ([]byte, error) {
return json.Marshal(string(f))
}
+2
View File
@@ -17,8 +17,10 @@ type Ticker struct {
ticker *time.Ticker
}
// Stop is a convenience wrapper around ticker.Stop
func (t *Ticker) Stop() { t.ticker.Stop() }
// Tick is a convenience wrapper around ticker.C
func (t *Ticker) Tick() { <-t.ticker.C }
// Retry is a wrapper around RetryWorker that provides a real RetryTicker
+1
View File
@@ -43,6 +43,7 @@ type httpClient interface {
Do(req *http.Request) (*http.Response, error)
}
// Interface to the TeamsAPIClient
type Interface interface {
TeamInfo(teamID, token string) (tm *Team, err error)
}