Skip to content

Commit e1a9f9d

Browse files
committed
fix: suppress gosec G703 false positive in CLI tool
1 parent 7a82eef commit e1a9f9d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cmd/liquid/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"fmt"
1515
"io"
1616
"os"
17+
"path/filepath"
1718
"strings"
1819

1920
"github.com/osteele/liquid"
@@ -69,7 +70,7 @@ func main() {
6970
case 0:
7071
// use stdin
7172
case 1:
72-
stdin, err = os.Open(args[0])
73+
stdin, err = os.Open(filepath.Clean(args[0])) //nolint:gosec // CLI tool intentionally opens user-specified files
7374
default:
7475
err = errors.New("too many arguments")
7576
}

0 commit comments

Comments
 (0)