try filetype
This commit is contained in:
parent
910651390d
commit
0f63ceedbe
5
main.go
5
main.go
|
@ -12,6 +12,7 @@ import (
|
|||
"regexp"
|
||||
"strings"
|
||||
"syscall"
|
||||
"github.com/h2non/filetype"
|
||||
"golang.org/x/crypto/ssh/terminal"
|
||||
)
|
||||
|
||||
|
@ -130,6 +131,10 @@ func main() {
|
|||
FileName = readFn()
|
||||
fn := FileName
|
||||
fmt.Println(fn)
|
||||
data := file2data(fn)
|
||||
fType, _ := filetype.Get(data)
|
||||
fmt.Println(fType.Extension)
|
||||
os.Exit(0)
|
||||
mode := getMode()
|
||||
switch mode {
|
||||
case "h":
|
||||
|
|
Loading…
Reference in New Issue