Skip to content

Commit ce5e399

Browse files
authored
Merge pull request #1027 from aledbf/doc-equals
Lint code
2 parents b2064cb + 681ca36 commit ce5e399

File tree

10 files changed

+21
-2
lines changed

10 files changed

+21
-2
lines changed

core/pkg/ingress/annotations/auth/main.go

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ type BasicDigest struct {
5353
Secured bool `json:"secured"`
5454
}
5555

56+
// Equal tests for equality between two BasicDigest types
5657
func (bd1 *BasicDigest) Equal(bd2 *BasicDigest) bool {
5758
if bd1 == bd2 {
5859
return true

core/pkg/ingress/annotations/authreq/main.go

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ type External struct {
4747
ResponseHeaders []string `json:"responseHeaders,omitEmpty"`
4848
}
4949

50+
// Equal tests for equality between two External types
5051
func (e1 *External) Equal(e2 *External) bool {
5152
if e1 == e2 {
5253
return true

core/pkg/ingress/annotations/authtls/main.go

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ type AuthSSLConfig struct {
4040
ValidationDepth int `json:"validationDepth"`
4141
}
4242

43+
// Equal tests for equality between two AuthSSLConfig types
4344
func (assl1 *AuthSSLConfig) Equal(assl2 *AuthSSLConfig) bool {
4445
if assl1 == assl2 {
4546
return true

core/pkg/ingress/annotations/ipwhitelist/main.go

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ type SourceRange struct {
3939
CIDR []string `json:"cidr,omitEmpty"`
4040
}
4141

42+
// Equal tests for equality between two SourceRange types
4243
func (sr1 *SourceRange) Equal(sr2 *SourceRange) bool {
4344
if sr1 == sr2 {
4445
return true

core/pkg/ingress/annotations/proxy/main.go

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ type Configuration struct {
4646
NextUpstream string `json:"nextUpstream"`
4747
}
4848

49+
// Equal tests for equality between two Configuration types
4950
func (l1 *Configuration) Equal(l2 *Configuration) bool {
5051
if l1 == l2 {
5152
return true

core/pkg/ingress/annotations/ratelimit/main.go

+2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ type RateLimit struct {
4747
RPS Zone `json:"rps"`
4848
}
4949

50+
// Equal tests for equality between two RateLimit types
5051
func (rt1 *RateLimit) Equal(rt2 *RateLimit) bool {
5152
if rt1 == rt2 {
5253
return true
@@ -74,6 +75,7 @@ type Zone struct {
7475
SharedSize int `json:"sharedSize"`
7576
}
7677

78+
// Equal tests for equality between two Zone types
7779
func (z1 *Zone) Equal(z2 *Zone) bool {
7880
if z1 == z2 {
7981
return true

core/pkg/ingress/annotations/rewrite/main.go

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ type Redirect struct {
4646
AppRoot string `json:"appRoot"`
4747
}
4848

49+
// Equal tests for equality between two Redirect types
4950
func (r1 *Redirect) Equal(r2 *Redirect) bool {
5051
if r1 == r2 {
5152
return true

core/pkg/ingress/annotations/serviceupstream/main_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ package serviceupstream
1919
import (
2020
"testing"
2121

22-
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
23-
"k8s.io/apimachinery/pkg/util/intstr"
2422
api "k8s.io/api/core/v1"
2523
extensions "k8s.io/api/extensions/v1beta1"
24+
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
25+
"k8s.io/apimachinery/pkg/util/intstr"
2626
)
2727

2828
func buildIngress() *extensions.Ingress {

core/pkg/ingress/resolver/main.go

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ type AuthSSLCert struct {
5252
PemSHA string `json:"pemSha"`
5353
}
5454

55+
// Equal tests for equality between two AuthSSLCert types
5556
func (asslc1 *AuthSSLCert) Equal(assl2 *AuthSSLCert) bool {
5657
if asslc1.Secret != assl2.Secret {
5758
return false

core/pkg/ingress/types_equals.go

+10
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ limitations under the License.
1616

1717
package ingress
1818

19+
// Equal tests for equality between two BackendInfo types
1920
func (bi1 *BackendInfo) Equal(bi2 *BackendInfo) bool {
2021
if bi1 == bi2 {
2122
return true
@@ -39,6 +40,7 @@ func (bi1 *BackendInfo) Equal(bi2 *BackendInfo) bool {
3940
return true
4041
}
4142

43+
// Equal tests for equality between two Configuration types
4244
func (c1 *Configuration) Equal(c2 *Configuration) bool {
4345
if c1 == c2 {
4446
return true
@@ -135,6 +137,7 @@ func (c1 *Configuration) Equal(c2 *Configuration) bool {
135137
return true
136138
}
137139

140+
// Equal tests for equality between two Backend types
138141
func (b1 *Backend) Equal(b2 *Backend) bool {
139142
if b1 == b2 {
140143
return true
@@ -199,6 +202,7 @@ func (b1 *Backend) Equal(b2 *Backend) bool {
199202
return true
200203
}
201204

205+
// Equal tests for equality between two SessionAffinityConfig types
202206
func (sac1 *SessionAffinityConfig) Equal(sac2 *SessionAffinityConfig) bool {
203207
if sac1 == sac2 {
204208
return true
@@ -216,6 +220,7 @@ func (sac1 *SessionAffinityConfig) Equal(sac2 *SessionAffinityConfig) bool {
216220
return true
217221
}
218222

223+
// Equal tests for equality between two CookieSessionAffinity types
219224
func (csa1 *CookieSessionAffinity) Equal(csa2 *CookieSessionAffinity) bool {
220225
if csa1 == csa2 {
221226
return true
@@ -257,6 +262,7 @@ func (e1 *Endpoint) Equal(e2 *Endpoint) bool {
257262
return true
258263
}
259264

265+
// Equal tests for equality between two Server types
260266
func (s1 *Server) Equal(s2 *Server) bool {
261267
if s1 == s2 {
262268
return true
@@ -297,6 +303,7 @@ func (s1 *Server) Equal(s2 *Server) bool {
297303
return true
298304
}
299305

306+
// Equal tests for equality between two Location types
300307
func (l1 *Location) Equal(l2 *Location) bool {
301308
if l1 == l2 {
302309
return true
@@ -371,6 +378,7 @@ func (l1 *Location) Equal(l2 *Location) bool {
371378
return true
372379
}
373380

381+
// Equal tests for equality between two SSLPassthroughBackend types
374382
func (ptb1 *SSLPassthroughBackend) Equal(ptb2 *SSLPassthroughBackend) bool {
375383
if ptb1 == ptb2 {
376384
return true
@@ -407,6 +415,7 @@ func (ptb1 *SSLPassthroughBackend) Equal(ptb2 *SSLPassthroughBackend) bool {
407415
return true
408416
}
409417

418+
// Equal tests for equality between two L4Service types
410419
func (e1 *L4Service) Equal(e2 *L4Service) bool {
411420
if e1 == e2 {
412421
return true
@@ -440,6 +449,7 @@ func (e1 *L4Service) Equal(e2 *L4Service) bool {
440449
return true
441450
}
442451

452+
// Equal tests for equality between two L4Backend types
443453
func (l4b1 *L4Backend) Equal(l4b2 *L4Backend) bool {
444454
if l4b1 == l4b2 {
445455
return true

0 commit comments

Comments
 (0)