mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-07 20:10:44 +02:00
fix golint fail #415
This commit is contained in:
@@ -19,6 +19,7 @@ type fieldInfo struct {
|
||||
Field reflect.Value
|
||||
}
|
||||
|
||||
// StringTemplate is string
|
||||
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 returns json.Marshal(byte slice) from StringTemplate
|
||||
func (f StringTemplate) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(string(f))
|
||||
}
|
||||
|
||||
@@ -17,8 +17,10 @@ type Ticker struct {
|
||||
ticker *time.Ticker
|
||||
}
|
||||
|
||||
// Stop returns ticker.Stop
|
||||
func (t *Ticker) Stop() { t.ticker.Stop() }
|
||||
|
||||
// Tick returns ticker.C
|
||||
func (t *Ticker) Tick() { <-t.ticker.C }
|
||||
|
||||
// Retry is a wrapper around RetryWorker that provides a real RetryTicker
|
||||
|
||||
@@ -43,6 +43,7 @@ type httpClient interface {
|
||||
Do(req *http.Request) (*http.Response, error)
|
||||
}
|
||||
|
||||
// Interface have to implement TeamInfo
|
||||
type Interface interface {
|
||||
TeamInfo(teamID, token string) (tm *Team, err error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user