Lint code

This commit is contained in:
Manuel de Brito Fontes 2017-07-26 23:07:59 -04:00
parent a56dd7cc38
commit 681ca36b1c
10 changed files with 21 additions and 2 deletions

View file

@ -53,6 +53,7 @@ type BasicDigest struct {
Secured bool `json:"secured"`
}
// Equal tests for equality between two BasicDigest types
func (bd1 *BasicDigest) Equal(bd2 *BasicDigest) bool {
if bd1 == bd2 {
return true

View file

@ -47,6 +47,7 @@ type External struct {
ResponseHeaders []string `json:"responseHeaders,omitEmpty"`
}
// Equal tests for equality between two External types
func (e1 *External) Equal(e2 *External) bool {
if e1 == e2 {
return true

View file

@ -40,6 +40,7 @@ type AuthSSLConfig struct {
ValidationDepth int `json:"validationDepth"`
}
// Equal tests for equality between two AuthSSLConfig types
func (assl1 *AuthSSLConfig) Equal(assl2 *AuthSSLConfig) bool {
if assl1 == assl2 {
return true

View file

@ -39,6 +39,7 @@ type SourceRange struct {
CIDR []string `json:"cidr,omitEmpty"`
}
// Equal tests for equality between two SourceRange types
func (sr1 *SourceRange) Equal(sr2 *SourceRange) bool {
if sr1 == sr2 {
return true

View file

@ -46,6 +46,7 @@ type Configuration struct {
NextUpstream string `json:"nextUpstream"`
}
// Equal tests for equality between two Configuration types
func (l1 *Configuration) Equal(l2 *Configuration) bool {
if l1 == l2 {
return true

View file

@ -47,6 +47,7 @@ type RateLimit struct {
RPS Zone `json:"rps"`
}
// Equal tests for equality between two RateLimit types
func (rt1 *RateLimit) Equal(rt2 *RateLimit) bool {
if rt1 == rt2 {
return true
@ -74,6 +75,7 @@ type Zone struct {
SharedSize int `json:"sharedSize"`
}
// Equal tests for equality between two Zone types
func (z1 *Zone) Equal(z2 *Zone) bool {
if z1 == z2 {
return true

View file

@ -46,6 +46,7 @@ type Redirect struct {
AppRoot string `json:"appRoot"`
}
// Equal tests for equality between two Redirect types
func (r1 *Redirect) Equal(r2 *Redirect) bool {
if r1 == r2 {
return true

View file

@ -19,10 +19,10 @@ package serviceupstream
import (
"testing"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
api "k8s.io/api/core/v1"
extensions "k8s.io/api/extensions/v1beta1"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
)
func buildIngress() *extensions.Ingress {

View file

@ -52,6 +52,7 @@ type AuthSSLCert struct {
PemSHA string `json:"pemSha"`
}
// Equal tests for equality between two AuthSSLCert types
func (asslc1 *AuthSSLCert) Equal(assl2 *AuthSSLCert) bool {
if asslc1.Secret != assl2.Secret {
return false

View file

@ -16,6 +16,7 @@ limitations under the License.
package ingress
// Equal tests for equality between two BackendInfo types
func (bi1 *BackendInfo) Equal(bi2 *BackendInfo) bool {
if bi1 == bi2 {
return true
@ -39,6 +40,7 @@ func (bi1 *BackendInfo) Equal(bi2 *BackendInfo) bool {
return true
}
// Equal tests for equality between two Configuration types
func (c1 *Configuration) Equal(c2 *Configuration) bool {
if c1 == c2 {
return true
@ -135,6 +137,7 @@ func (c1 *Configuration) Equal(c2 *Configuration) bool {
return true
}
// Equal tests for equality between two Backend types
func (b1 *Backend) Equal(b2 *Backend) bool {
if b1 == b2 {
return true
@ -199,6 +202,7 @@ func (b1 *Backend) Equal(b2 *Backend) bool {
return true
}
// Equal tests for equality between two SessionAffinityConfig types
func (sac1 *SessionAffinityConfig) Equal(sac2 *SessionAffinityConfig) bool {
if sac1 == sac2 {
return true
@ -216,6 +220,7 @@ func (sac1 *SessionAffinityConfig) Equal(sac2 *SessionAffinityConfig) bool {
return true
}
// Equal tests for equality between two CookieSessionAffinity types
func (csa1 *CookieSessionAffinity) Equal(csa2 *CookieSessionAffinity) bool {
if csa1 == csa2 {
return true
@ -257,6 +262,7 @@ func (e1 *Endpoint) Equal(e2 *Endpoint) bool {
return true
}
// Equal tests for equality between two Server types
func (s1 *Server) Equal(s2 *Server) bool {
if s1 == s2 {
return true
@ -297,6 +303,7 @@ func (s1 *Server) Equal(s2 *Server) bool {
return true
}
// Equal tests for equality between two Location types
func (l1 *Location) Equal(l2 *Location) bool {
if l1 == l2 {
return true
@ -371,6 +378,7 @@ func (l1 *Location) Equal(l2 *Location) bool {
return true
}
// Equal tests for equality between two SSLPassthroughBackend types
func (ptb1 *SSLPassthroughBackend) Equal(ptb2 *SSLPassthroughBackend) bool {
if ptb1 == ptb2 {
return true
@ -407,6 +415,7 @@ func (ptb1 *SSLPassthroughBackend) Equal(ptb2 *SSLPassthroughBackend) bool {
return true
}
// Equal tests for equality between two L4Service types
func (e1 *L4Service) Equal(e2 *L4Service) bool {
if e1 == e2 {
return true
@ -440,6 +449,7 @@ func (e1 *L4Service) Equal(e2 *L4Service) bool {
return true
}
// Equal tests for equality between two L4Backend types
func (l4b1 *L4Backend) Equal(l4b2 *L4Backend) bool {
if l4b1 == l4b2 {
return true