Skip to content

Commit 98e9f15

Browse files
authored
fix: fix direct error comparison (#3314)
1 parent c902cd5 commit 98e9f15

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

internal/namespaces/instance/v1/custom_ssh_config.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package instance
22

33
import (
44
"context"
5+
"errors"
56
"fmt"
67
"reflect"
78
"strings"
@@ -110,7 +111,7 @@ Do you want the include statement to be added at the beginning of your file ?`,
110111
// Generated config needs an include statement in default config
111112
included, err := sshconfig.ConfigIsIncluded(homeDir)
112113
if err != nil {
113-
if err == sshconfig.ErrFileNotFound {
114+
if errors.Is(err, sshconfig.ErrFileNotFound) {
114115
includePrompt += "\nFile was not found, it will be created"
115116
} else {
116117
logger.Warningf("Failed to check default config file, skipping include prompt\n")

internal/sshconfig/sshconfig.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ func IncludeConfigFile(homeDir string) error {
133133
fileContent := []byte(nil)
134134

135135
configFile, err := openDefaultConfigFile(homeDir)
136-
if err != nil && err != ErrFileNotFound {
136+
if err != nil && !errors.Is(err, ErrFileNotFound) {
137137
return err
138138
}
139139

0 commit comments

Comments
 (0)