chore: update linter
This commit is contained in:
parent
9c50129520
commit
f437fb4230
38 changed files with 796 additions and 830 deletions
|
@ -85,12 +85,12 @@ func init() {
|
|||
Interval: "foo",
|
||||
Timeout: "foo",
|
||||
Hostname: "foo",
|
||||
FollowRedirects: boolPtr(true),
|
||||
FollowRedirects: pointer(true),
|
||||
Headers: map[string]string{
|
||||
"foo": "bar",
|
||||
},
|
||||
},
|
||||
PassHostHeader: boolPtr(true),
|
||||
PassHostHeader: pointer(true),
|
||||
ResponseForwarding: &dynamic.ResponseForwarding{
|
||||
FlushInterval: "foo",
|
||||
},
|
||||
|
@ -107,7 +107,7 @@ func init() {
|
|||
Services: []dynamic.WRRService{
|
||||
{
|
||||
Name: "foo",
|
||||
Weight: intPtr(42),
|
||||
Weight: pointer(42),
|
||||
},
|
||||
},
|
||||
Sticky: &dynamic.Sticky{
|
||||
|
@ -123,7 +123,7 @@ func init() {
|
|||
"baz": {
|
||||
Mirroring: &dynamic.Mirroring{
|
||||
Service: "foo",
|
||||
MaxBodySize: int64Ptr(42),
|
||||
MaxBodySize: pointer[int64](42),
|
||||
Mirrors: []dynamic.MirrorService{
|
||||
{
|
||||
Name: "foo",
|
||||
|
@ -379,7 +379,7 @@ func init() {
|
|||
Services: map[string]*dynamic.TCPService{
|
||||
"foo": {
|
||||
LoadBalancer: &dynamic.TCPServersLoadBalancer{
|
||||
TerminationDelay: intPtr(42),
|
||||
TerminationDelay: pointer(42),
|
||||
ProxyProtocol: &dynamic.ProxyProtocol{
|
||||
Version: 42,
|
||||
},
|
||||
|
@ -395,7 +395,7 @@ func init() {
|
|||
Services: []dynamic.TCPWRRService{
|
||||
{
|
||||
Name: "foo",
|
||||
Weight: intPtr(42),
|
||||
Weight: pointer(42),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -424,7 +424,7 @@ func init() {
|
|||
Services: []dynamic.UDPWRRService{
|
||||
{
|
||||
Name: "foo",
|
||||
Weight: intPtr(42),
|
||||
Weight: pointer(42),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -481,7 +481,7 @@ func TestAnonymize_dynamicConfiguration(t *testing.T) {
|
|||
}
|
||||
|
||||
expected := strings.TrimSuffix(string(expectedConfiguration), "\n")
|
||||
assert.Equal(t, expected, cleanJSON)
|
||||
assert.JSONEq(t, expected, cleanJSON)
|
||||
}
|
||||
|
||||
func TestSecure_dynamicConfiguration(t *testing.T) {
|
||||
|
@ -498,7 +498,7 @@ func TestSecure_dynamicConfiguration(t *testing.T) {
|
|||
}
|
||||
|
||||
expected := strings.TrimSuffix(string(expectedConfiguration), "\n")
|
||||
assert.Equal(t, expected, cleanJSON)
|
||||
assert.JSONEq(t, expected, cleanJSON)
|
||||
}
|
||||
|
||||
func TestDo_staticConfiguration(t *testing.T) {
|
||||
|
@ -990,17 +990,7 @@ func TestDo_staticConfiguration(t *testing.T) {
|
|||
}
|
||||
|
||||
expected := strings.TrimSuffix(string(expectedConfiguration), "\n")
|
||||
assert.Equal(t, expected, cleanJSON)
|
||||
assert.JSONEq(t, expected, cleanJSON)
|
||||
}
|
||||
|
||||
func boolPtr(value bool) *bool {
|
||||
return &value
|
||||
}
|
||||
|
||||
func intPtr(value int) *int {
|
||||
return &value
|
||||
}
|
||||
|
||||
func int64Ptr(value int64) *int64 {
|
||||
return &value
|
||||
}
|
||||
func pointer[T any](v T) *T { return &v }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue