Skip to content

Commit d2d2a89

Browse files
committed
Optimize a slice initialization
1 parent 78bed84 commit d2d2a89

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

hooks/jsonnet-fmt-hook/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ func diffJsonnetFmt(f string) (*Diff, error) {
171171
func execJsonnetFmt(f string, opts []string) error {
172172
var stdout, stderr bytes.Buffer
173173

174-
args := []string{}
174+
args := make([]string, 0, len(opts)+2)
175175
args = append(args, opts...)
176176
args = append(args, "--")
177177
args = append(args, f)

0 commit comments

Comments
 (0)