From 461b5350c391229fd45bc2f876dce70ef136c52a Mon Sep 17 00:00:00 2001 From: riacataquian Date: Fri, 27 May 2022 20:11:52 +0800 Subject: [PATCH] shfmt: fix typo on FormatPath's the `io.ReadAtLeast` at a minimum, checks for the shebang directive but we're missing the `!` --- cmd/shfmt/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/shfmt/main.go b/cmd/shfmt/main.go index f1779e9dd..798e3eb69 100644 --- a/cmd/shfmt/main.go +++ b/cmd/shfmt/main.go @@ -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