Refactor usage() in dirname

feature/pwd
dtluna 6 years ago
parent a562d6acdb
commit 289851b20f
  1. 2
      dirname/dirname.go

@ -8,12 +8,12 @@ import (
func usage() { func usage() {
fmt.Printf("usage: %v path\n", os.Args[0]) fmt.Printf("usage: %v path\n", os.Args[0])
os.Exit(1)
} }
func main() { func main() {
if len(os.Args) != 2 { if len(os.Args) != 2 {
usage() usage()
os.Exit(1)
} }
fmt.Println(path.Dir(os.Args[1])) fmt.Println(path.Dir(os.Args[1]))

Loading…
Cancel
Save