getMode func removed
This commit is contained in:
parent
69fdf6b6ed
commit
a3623f8e7e
18
main.go
18
main.go
|
@ -10,7 +10,6 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"regexp"
|
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
"github.com/h2non/filetype"
|
"github.com/h2non/filetype"
|
||||||
|
@ -74,23 +73,6 @@ func data2file(filename string, data []byte) {
|
||||||
f.Write(data)
|
f.Write(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
func getMode() string {
|
|
||||||
var mode string
|
|
||||||
match, _ := regexp.Match(`.*\.hdn$`,[]byte(FileName))
|
|
||||||
if match {
|
|
||||||
return "s"
|
|
||||||
}
|
|
||||||
fmt.Print("mode: ")
|
|
||||||
fmt.Fscan(os.Stdin, &mode)
|
|
||||||
if mode == "q" {os.Exit(1)}
|
|
||||||
if mode != "h" && mode != "s" {
|
|
||||||
fmt.Println("not a mode")
|
|
||||||
fmt.Println("type 'h' for hide, 's' for show or 'q' to quit")
|
|
||||||
mode = getMode()
|
|
||||||
}
|
|
||||||
return mode
|
|
||||||
}
|
|
||||||
|
|
||||||
func readFn() string {
|
func readFn() string {
|
||||||
var filename string
|
var filename string
|
||||||
arg := os.Args[1:]
|
arg := os.Args[1:]
|
||||||
|
|
Loading…
Reference in New Issue