Skip to content

Commit 531a6dc

Browse files
committed
fix: linting issue directly return value of HasPrefix instead of unnecessary if else block
1 parent 316e9a8 commit 531a6dc

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

internal/providers/util/cloudconfig.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,10 @@ import (
2020

2121
func IsCloudConfig(contents []byte) bool {
2222
header := []byte("#cloud-config\n")
23-
if bytes.HasPrefix(contents, header) {
24-
return true
25-
}
26-
return false
23+
return bytes.HasPrefix(contents, header)
2724
}
2825

2926
func IsShellScript(contents []byte) bool {
3027
header := []byte("#!/bin/\n")
31-
if bytes.HasPrefix(contents, header) {
32-
return true
33-
}
34-
35-
return false
28+
return bytes.HasPrefix(contents, header)
3629
}

0 commit comments

Comments
 (0)