From f06ad67d0f520901aa6a773bdd270041ff6c43eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Miri=C4=87?= Date: Thu, 10 Sep 2020 15:06:00 +0200 Subject: [PATCH] Rename DNSConfig unmarshall method to avoid stutter --- lib/options.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/options.go b/lib/options.go index 360af89703c..9d0caed04e4 100644 --- a/lib/options.go +++ b/lib/options.go @@ -77,7 +77,7 @@ func DefaultDNSConfig() DNSConfig { } func (c DNSConfig) MarshalJSON() ([]byte, error) { - strat := "" + var strat string if c.Strategy.IsADNSStrategy() { strat = c.Strategy.String() } @@ -95,7 +95,7 @@ func (c *DNSConfig) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, ¶ms); err != nil { return err } - return c.unmarshalDNSConfig(params) + return c.unmarshal(params) } func (c *DNSConfig) UnmarshalText(text []byte) error { @@ -107,10 +107,10 @@ func (c *DNSConfig) UnmarshalText(text []byte) error { if err != nil { return err } - return c.unmarshalDNSConfig(params) + return c.unmarshal(params) } -func (c *DNSConfig) unmarshalDNSConfig(params map[string]interface{}) error { +func (c *DNSConfig) unmarshal(params map[string]interface{}) error { if ttl, ok := params["ttl"]; ok && ttl != "" { c.TTL = null.StringFrom(fmt.Sprintf("%v", ttl)) }