mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
chore: remove unnecessary redeclarations in for loops (#18440)
This commit is contained in:
@ -200,7 +200,6 @@ func TestExtractAddress(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
test := test
|
||||
t.Run(test.Name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
@ -235,9 +234,6 @@ func TestTrustedOrigins(t *testing.T) {
|
||||
// ipv6: trust an IPv4 network
|
||||
for _, trusted := range []string{"none", "ipv4", "ipv6"} {
|
||||
for _, header := range []string{"Cf-Connecting-Ip", "True-Client-Ip", "X-Real-Ip", "X-Forwarded-For"} {
|
||||
trusted := trusted
|
||||
header := header
|
||||
proto := proto
|
||||
name := fmt.Sprintf("%s-%s-%s", trusted, proto, strings.ToLower(header))
|
||||
|
||||
t.Run(name, func(t *testing.T) {
|
||||
@ -311,7 +307,6 @@ func TestCorruptedHeaders(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
for _, header := range []string{"Cf-Connecting-Ip", "True-Client-Ip", "X-Real-Ip", "X-Forwarded-For"} {
|
||||
header := header
|
||||
name := strings.ToLower(header)
|
||||
|
||||
t.Run(name, func(t *testing.T) {
|
||||
@ -364,9 +359,6 @@ func TestAddressFamilies(t *testing.T) {
|
||||
for _, clientFamily := range []string{"ipv4", "ipv6"} {
|
||||
for _, proxyFamily := range []string{"ipv4", "ipv6"} {
|
||||
for _, header := range []string{"Cf-Connecting-Ip", "True-Client-Ip", "X-Real-Ip", "X-Forwarded-For"} {
|
||||
clientFamily := clientFamily
|
||||
proxyFamily := proxyFamily
|
||||
header := header
|
||||
name := fmt.Sprintf("%s-%s-%s", strings.ToLower(header), clientFamily, proxyFamily)
|
||||
|
||||
t.Run(name, func(t *testing.T) {
|
||||
@ -466,7 +458,6 @@ func TestFilterUntrusted(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
test := test
|
||||
t.Run(test.Name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
@ -612,7 +603,6 @@ func TestApplicationProxy(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
test := test
|
||||
t.Run(test.Name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
|
Reference in New Issue
Block a user