try filetype

This commit is contained in:
ed 2019-12-18 14:10:48 +01:00
parent 910651390d
commit 0f63ceedbe
1 changed files with 5 additions and 0 deletions

View File

@ -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":