diff --git a/fileutil/file.go b/fileutil/file.go
index <HASH>..<HASH> 100644
--- a/fileutil/file.go
+++ b/fileutil/file.go
@@ -47,7 +47,23 @@ const (
 //
 // Deprecated: prefer CouldBeScript2, which usually requires fewer syscalls.
 func CouldBeScript(info os.FileInfo) ScriptConfidence {
-	return CouldBeScript2(fs.FileInfoToDirEntry(info))
+	// TODO: once we drop support for Go 1.16,
+	// make use of this Go 1.17 API instead:
+	// return CouldBeScript2(fs.FileInfoToDirEntry(info))
+
+	name := info.Name()
+	switch {
+	case info.IsDir(), name[0] == '.':
+		return ConfNotScript
+	case info.Mode()&os.ModeSymlink != 0:
+		return ConfNotScript
+	case extRe.MatchString(name):
+		return ConfIsScript
+	case strings.IndexByte(name, '.') > 0:
+		return ConfNotScript // different extension
+	default:
+		return ConfIfShebang
+	}
 }
 
 // CouldBeScript2 reports how likely a directory entry is to be a shell script.
fileutil: build on Go <I> again

I had not noticed that FileInfoToDirEntry was added in <I>.
For now, copy paste the implementation.