1
0
Fork 0

chore: update linter

This commit is contained in:
Ludovic Fernandez 2024-11-12 10:56:06 +01:00 committed by GitHub
parent 9c50129520
commit f437fb4230
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
38 changed files with 796 additions and 830 deletions

View file

@ -11,8 +11,7 @@ import (
"github.com/traefik/traefik/v2/pkg/types"
)
func Int(v int) *int { return &v }
func Bool(v bool) *bool { return &v }
func pointer[T any](v T) *T { return &v }
func Test_buildConfiguration(t *testing.T) {
testCases := []struct {
@ -60,7 +59,7 @@ func Test_buildConfiguration(t *testing.T) {
URL: "http://127.0.0.1:80",
},
},
PassHostHeader: Bool(true),
PassHostHeader: pointer(true),
},
},
},
@ -123,7 +122,7 @@ func Test_buildConfiguration(t *testing.T) {
URL: "http://127.0.0.1:80",
},
},
PassHostHeader: Bool(true),
PassHostHeader: pointer(true),
},
},
"Test2": {
@ -133,7 +132,7 @@ func Test_buildConfiguration(t *testing.T) {
URL: "http://127.0.0.2:80",
},
},
PassHostHeader: Bool(true),
PassHostHeader: pointer(true),
},
},
},
@ -199,7 +198,7 @@ func Test_buildConfiguration(t *testing.T) {
URL: "http://127.0.0.2:80",
},
},
PassHostHeader: Bool(true),
PassHostHeader: pointer(true),
},
},
"Test2": {
@ -209,7 +208,7 @@ func Test_buildConfiguration(t *testing.T) {
URL: "http://128.0.0.1:80",
},
},
PassHostHeader: Bool(true),
PassHostHeader: pointer(true),
},
},
},
@ -262,7 +261,7 @@ func Test_buildConfiguration(t *testing.T) {
URL: "http://127.0.0.1:80",
},
},
PassHostHeader: Bool(true),
PassHostHeader: pointer(true),
},
},
},
@ -377,7 +376,7 @@ func Test_buildConfiguration(t *testing.T) {
URL: "http://127.0.0.1:80",
},
},
PassHostHeader: Bool(true),
PassHostHeader: pointer(true),
},
},
},
@ -466,7 +465,7 @@ func Test_buildConfiguration(t *testing.T) {
URL: "http://127.0.0.1:80",
},
},
PassHostHeader: Bool(true),
PassHostHeader: pointer(true),
},
},
},
@ -529,7 +528,7 @@ func Test_buildConfiguration(t *testing.T) {
URL: "http://127.0.0.1:80",
},
},
PassHostHeader: Bool(true),
PassHostHeader: pointer(true),
},
},
},
@ -580,7 +579,7 @@ func Test_buildConfiguration(t *testing.T) {
Address: "127.0.0.1:80",
},
},
TerminationDelay: Int(100),
TerminationDelay: pointer(100),
},
},
},
@ -641,7 +640,7 @@ func Test_buildConfiguration(t *testing.T) {
URL: "http://127.0.0.1:80",
},
},
PassHostHeader: Bool(true),
PassHostHeader: pointer(true),
},
},
},
@ -685,7 +684,7 @@ func Test_buildConfiguration(t *testing.T) {
Address: "127.0.0.1:80",
},
},
TerminationDelay: Int(100),
TerminationDelay: pointer(100),
},
},
},
@ -781,7 +780,7 @@ func Test_buildConfiguration(t *testing.T) {
Address: "127.0.0.1:80",
},
},
TerminationDelay: Int(100),
TerminationDelay: pointer(100),
},
},
},
@ -833,7 +832,7 @@ func Test_buildConfiguration(t *testing.T) {
Address: "127.0.0.1:8080",
},
},
TerminationDelay: Int(100),
TerminationDelay: pointer(100),
},
},
},
@ -942,7 +941,7 @@ func Test_buildConfiguration(t *testing.T) {
Address: "127.0.0.2:8080",
},
},
TerminationDelay: Int(100),
TerminationDelay: pointer(100),
},
},
},
@ -971,7 +970,7 @@ func Test_buildConfiguration(t *testing.T) {
URL: "http://127.0.0.2:80",
},
},
PassHostHeader: Bool(true),
PassHostHeader: pointer(true),
},
},
},
@ -1046,7 +1045,7 @@ func Test_buildConfiguration(t *testing.T) {
URL: "http://127.0.0.2:80",
},
},
PassHostHeader: Bool(true),
PassHostHeader: pointer(true),
},
},
},
@ -1083,7 +1082,7 @@ func Test_buildConfiguration(t *testing.T) {
Address: "127.0.0.1:8080",
},
},
TerminationDelay: Int(100),
TerminationDelay: pointer(100),
},
},
},
@ -1175,7 +1174,7 @@ func Test_buildConfiguration(t *testing.T) {
Address: "127.0.0.1:8080",
},
},
TerminationDelay: Int(200),
TerminationDelay: pointer(200),
},
},
},
@ -1238,7 +1237,7 @@ func Test_buildConfiguration(t *testing.T) {
URL: "http://127.0.0.1:80",
},
},
PassHostHeader: Bool(true),
PassHostHeader: pointer(true),
},
},
},