cleanup: omit comparison with bool constants

Signed-off-by: tao.yang <tao.yang@daocloud.io>

Kubernetes-commit: b35357b6c08f21ba0fd312536051394c2567ec79
This commit is contained in:
tao.yang 2023-09-04 16:59:23 +08:00 committed by Kubernetes Publisher
parent 2ccb201c19
commit 67ef0ca456
1 changed files with 2 additions and 2 deletions

View File

@ -254,10 +254,10 @@ func TestGetBool(t *testing.T) {
for _, tt := range testCases {
t.Run(tt.name, func(t *testing.T) {
got, err := GetBool(tt.parameters, tt.key, tt.defaultValue)
if err != nil && tt.expectError == false {
if err != nil && !tt.expectError {
t.Errorf("%s: unexpected error: %v", tt.name, err)
}
if err == nil && tt.expectError == true {
if err == nil && tt.expectError {
t.Errorf("%s: expect error, got nil", tt.name)
}
if got != tt.expected {