Skip to content

Commit

Permalink
Remove exit function
Browse files Browse the repository at this point in the history
  • Loading branch information
lotusirous committed Dec 13, 2021
1 parent f5fcb57 commit 12d25a4
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,6 @@ func usage() {
os.Exit(2)
}

func exit(w io.Writer, a ...interface{}) {
fmt.Fprintln(w, a...)
os.Exit(1)
}

var (
verbose = flag.Bool("v", false, `print the file hash in (md5, sha1, sha256)`)
)
Expand All @@ -99,7 +94,8 @@ func main() {

abs, fi, err := ReadFileInfo(path)
if err != nil {
exit(fd, "Cannot resolve the path: ", err)
fmt.Fprintln(fd, "Cannot resolve the path: ", err)
os.Exit(1)
}

fmt.Fprintf(fd, "PATH: %s\n", abs)
Expand Down

0 comments on commit 12d25a4

Please sign in to comment.