Skip to content

Commit 2aa5eb9

Browse files
chore: omit nil check
The static tests complains: `should omit nil check; len() for nil slices is defined as zero (gosimple)` Signed-off-by: Daniel Skinstad Drabitzius <daniel.drabitzius@northern.tech>
1 parent f337c0b commit 2aa5eb9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

artifact/scripter.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func (s *Scripts) Add(path string) error {
5353
// the first element should be the whole matched name of the script and
5454
// the second one shold be the name of the state
5555
matches := re.FindStringSubmatch(name)
56-
if matches == nil || len(matches) < 3 {
56+
if len(matches) < 3 {
5757
return errors.Errorf(
5858
"Invalid script name: %q. Scripts must have a name on the form:"+
5959
" <STATE_NAME>_<ACTION>_<ORDERING_NUMBER>_<OPTIONAL_DESCRIPTION>."+

0 commit comments

Comments
 (0)