error
construction with fmt.Errorf
SCC-S1028 75 }
76
77 if !found {
78 return errors.New(fmt.Sprintf("resource type '%s' is not found", command.ResourceType.ResourceName)) 79 }
80
81 confirmed, err := command.warningMessage(shared)
48 }
49
50 if !found {
51 return errors.New(fmt.Sprintf("resource '%s' is not found", command.Resource.ResourceName)) 52 }
53
54 confirmed, err := command.warningMessage(shared)
85 return atc.ResourceVersion{}, err
86 }
87
88 return atc.ResourceVersion{}, errors.New(fmt.Sprintf("could not find version matching %s", string(versionBytes)))89 }
90
91 return versions[0], nil
Error construction could be simplified by using fmt.Errorf(…)
errors.New(fmt.Sprintf(...))
fmt.Errorf(...)