diff --git a/acme/account.go b/acme/account.go index b73c73bc5..a9f2c5421 100644 --- a/acme/account.go +++ b/acme/account.go @@ -236,7 +236,7 @@ func (dc *DomainsCertificate) needRenew() bool { return true } // <= 30 days left, renew certificate - if crt.NotAfter.Before(time.Now().Add(time.Duration(24 * 30 * time.Hour))) { + if crt.NotAfter.Before(time.Now().Add(24 * 30 * time.Hour)) { return true } } diff --git a/acme/challengeProvider.go b/acme/challengeProvider.go index 3afd481e2..9a678e4d4 100644 --- a/acme/challengeProvider.go +++ b/acme/challengeProvider.go @@ -143,7 +143,7 @@ func pemEncode(data interface{}) []byte { case *x509.CertificateRequest: pemBlock = &pem.Block{Type: "CERTIFICATE REQUEST", Bytes: key.Raw} case []byte: - pemBlock = &pem.Block{Type: "CERTIFICATE", Bytes: []byte(data.([]byte))} + pemBlock = &pem.Block{Type: "CERTIFICATE", Bytes: data.([]byte)} } return pem.EncodeToMemory(pemBlock) diff --git a/configuration/configuration.go b/configuration/configuration.go index bc9a1816a..9609eea72 100644 --- a/configuration/configuration.go +++ b/configuration/configuration.go @@ -267,12 +267,12 @@ func (dep *DefaultEntryPoints) Set(value string) error { // Get return the EntryPoints map func (dep *DefaultEntryPoints) Get() interface{} { - return DefaultEntryPoints(*dep) + return *dep } // SetValue sets the EntryPoints map with val func (dep *DefaultEntryPoints) SetValue(val interface{}) { - *dep = DefaultEntryPoints(val.(DefaultEntryPoints)) + *dep = val.(DefaultEntryPoints) } // Type is type of the struct @@ -405,12 +405,12 @@ func toBool(conf map[string]string, key string) bool { // Get return the EntryPoints map func (ep *EntryPoints) Get() interface{} { - return EntryPoints(*ep) + return *ep } // SetValue sets the EntryPoints map with val func (ep *EntryPoints) SetValue(val interface{}) { - *ep = EntryPoints(val.(EntryPoints)) + *ep = val.(EntryPoints) } // Type is type of the struct diff --git a/provider/ecs/cluster.go b/provider/ecs/cluster.go index cb602b9be..c9e948d29 100644 --- a/provider/ecs/cluster.go +++ b/provider/ecs/cluster.go @@ -21,12 +21,12 @@ func (c *Clusters) Set(str string) error { } // Get Clusters -func (c *Clusters) Get() interface{} { return Clusters(*c) } +func (c *Clusters) Get() interface{} { return *c } // String return slice in a string func (c *Clusters) String() string { return fmt.Sprintf("%v", *c) } // SetValue sets Clusters into the parser func (c *Clusters) SetValue(val interface{}) { - *c = Clusters(val.(Clusters)) + *c = val.(Clusters) } diff --git a/provider/kubernetes/namespace.go b/provider/kubernetes/namespace.go index f6b31bde1..b5bb0ec42 100644 --- a/provider/kubernetes/namespace.go +++ b/provider/kubernetes/namespace.go @@ -21,12 +21,12 @@ func (ns *Namespaces) Set(str string) error { } //Get []string -func (ns *Namespaces) Get() interface{} { return Namespaces(*ns) } +func (ns *Namespaces) Get() interface{} { return *ns } //String return slice in a string func (ns *Namespaces) String() string { return fmt.Sprintf("%v", *ns) } //SetValue sets []string into the parser func (ns *Namespaces) SetValue(val interface{}) { - *ns = Namespaces(val.(Namespaces)) + *ns = val.(Namespaces) } diff --git a/server/server.go b/server/server.go index 7c252929e..4277d5f27 100644 --- a/server/server.go +++ b/server/server.go @@ -862,7 +862,7 @@ func buildServerTimeouts(globalConfig configuration.GlobalConfiguration) (readTi } else if globalConfig.RespondingTimeouts != nil { idleTimeout = time.Duration(globalConfig.RespondingTimeouts.IdleTimeout) } else { - idleTimeout = time.Duration(configuration.DefaultIdleTimeout) + idleTimeout = configuration.DefaultIdleTimeout } return readTimeout, writeTimeout, idleTimeout diff --git a/tls/tls.go b/tls/tls.go index 451cfb511..51f66f9d7 100644 --- a/tls/tls.go +++ b/tls/tls.go @@ -80,12 +80,12 @@ func (r *RootCAs) Set(value string) error { // Get return the RootCAs list func (r *RootCAs) Get() interface{} { - return RootCAs(*r) + return *r } // SetValue sets the RootCAs with val func (r *RootCAs) SetValue(val interface{}) { - *r = RootCAs(val.(RootCAs)) + *r = val.(RootCAs) } // Type is type of the struct diff --git a/types/types.go b/types/types.go index 0625b2271..3217547bf 100644 --- a/types/types.go +++ b/types/types.go @@ -312,7 +312,7 @@ func (cs *Constraints) String() string { return fmt.Sprintf("%+v", *cs) } //SetValue sets []*Constraint into the parser func (cs *Constraints) SetValue(val interface{}) { - *cs = Constraints(val.(Constraints)) + *cs = val.(Constraints) } // Type exports the Constraints type as a string @@ -427,14 +427,14 @@ func (b *Buckets) Set(str string) error { } //Get []float64 -func (b *Buckets) Get() interface{} { return Buckets(*b) } +func (b *Buckets) Get() interface{} { return *b } //String return slice in a string func (b *Buckets) String() string { return fmt.Sprintf("%v", *b) } //SetValue sets []float64 into the parser func (b *Buckets) SetValue(val interface{}) { - *b = Buckets(val.(Buckets)) + *b = val.(Buckets) } // TraefikLog holds the configuration settings for the traefik logger.