Skip to content

Commit

Permalink
shfmt: fix typo on FormatPath's
Browse files Browse the repository at this point in the history
the `io.ReadAtLeast` at a minimum, checks for the shebang
directive but we're missing the `!`
  • Loading branch information
riacataquian committed May 27, 2022
1 parent 169e304 commit 461b535
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/shfmt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ func formatPath(path string, checkShebang bool) error {
}
readBuf.Reset()
if checkShebang || shebangForAuto {
n, err := io.ReadAtLeast(f, copyBuf[:32], len("#/bin/sh\n"))
n, err := io.ReadAtLeast(f, copyBuf[:32], len("#!/bin/sh\n"))
switch {
case !checkShebang:
// only wanted the shebang for LangAuto
Expand Down

0 comments on commit 461b535

Please sign in to comment.