Skip to content

Commit

Permalink
fileutil: document the three ScriptConfidence values
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdan committed Sep 29, 2020
1 parent 9096347 commit a6888f2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions fileutil/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,17 @@ func HasShebang(bs []byte) bool {
type ScriptConfidence int

const (
// ConfNotScript describes files which are definitely not shell scripts,
// such as non-regular files or files with a non-shell extension.
ConfNotScript ScriptConfidence = iota

// ConfIfShebang describes files which might be shell scripts, depending
// on the shebang line in the file's contents. Since CouldBeScript only
// works on os.FileInfo, the answer in this case can't be final.
ConfIfShebang

// ConfIsScript describes files which are definitely shell scripts,
// which are regular files with a valid shell extension.
ConfIsScript
)

Expand Down

0 comments on commit a6888f2

Please sign in to comment.