Skip to content

Commit caa511f

Browse files
committed
Optimize a slice initialization
1 parent 74a060a commit caa511f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

hooks/jsonnet-lint-hook/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ func (e *LintError) Error() string {
2828
}
2929

3030
func execJsonnetLint(f string, opts []string) error {
31-
var args []string
3231
var stderr bytes.Buffer
3332

33+
args := make([]string, 0, len(opts)+2)
3434
args = append(args, opts...)
3535
args = append(args, "--")
3636
args = append(args, f)

0 commit comments

Comments
 (0)