From 70833a3c21f09a2de786de6575a9131d1734fa5d Mon Sep 17 00:00:00 2001 From: yassinebenaid Date: Sat, 27 Jan 2024 18:09:22 +0100 Subject: [PATCH 1/2] fix type redundancy --- flag_mutex_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flag_mutex_test.go b/flag_mutex_test.go index 725e277f2a..b1463fcedd 100644 --- a/flag_mutex_test.go +++ b/flag_mutex_test.go @@ -12,7 +12,7 @@ func TestFlagMutuallyExclusiveFlags(t *testing.T) { MutuallyExclusiveFlags: []MutuallyExclusiveFlags{ { Flags: [][]Flag{ - []Flag{ + { &IntFlag{ Name: "i", }, @@ -20,7 +20,7 @@ func TestFlagMutuallyExclusiveFlags(t *testing.T) { Name: "s", }, }, - []Flag{ + { &IntFlag{ Name: "t", Aliases: []string{"ai"}, From 923f1ef838990ceab055ce22a35c4af0f4ce8f77 Mon Sep 17 00:00:00 2001 From: yassinebenaid Date: Sat, 27 Jan 2024 18:11:17 +0100 Subject: [PATCH 2/2] change variable name to follow the golang community conventions --- flag_bool_with_inverse_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flag_bool_with_inverse_test.go b/flag_bool_with_inverse_test.go index 9167851e2d..bf62d73dd0 100644 --- a/flag_bool_with_inverse_test.go +++ b/flag_bool_with_inverse_test.go @@ -10,7 +10,7 @@ import ( ) var ( - bothEnvFlagsAreSetError = fmt.Errorf("cannot set both flags `--env` and `--no-env`") + errBothEnvFlagsAreSet = fmt.Errorf("cannot set both flags `--env` and `--no-env`") ) type boolWithInverseTestCase struct { @@ -98,7 +98,7 @@ func TestBoolWithInverseBasic(t *testing.T) { }, { args: []string{"--env", "--no-env"}, - err: bothEnvFlagsAreSetError, + err: errBothEnvFlagsAreSet, }, } @@ -146,7 +146,7 @@ func TestBoolWithInverseAction(t *testing.T) { }, { args: []string{"--env", "--no-env"}, - err: bothEnvFlagsAreSetError, + err: errBothEnvFlagsAreSet, }, } @@ -184,7 +184,7 @@ func TestBoolWithInverseAlias(t *testing.T) { }, { args: []string{"--do-env", "--no-do-env"}, - err: bothEnvFlagsAreSetError, + err: errBothEnvFlagsAreSet, }, } @@ -232,7 +232,7 @@ func TestBoolWithInverseEnvVars(t *testing.T) { value: false, }, { - err: bothEnvFlagsAreSetError, + err: errBothEnvFlagsAreSet, envVars: map[string]string{ "ENV": "true", "NO-ENV": "true", @@ -313,7 +313,7 @@ func TestBoolWithInverseRequired(t *testing.T) { }, { args: []string{"--env", "--no-env"}, - err: bothEnvFlagsAreSetError, + err: errBothEnvFlagsAreSet, }, }