mirror of
http://git.dtluna.net/tomo/go-coreutils.git
synced 2025-01-07 06:39:54 +00:00
Refactor usage() in dirname
This commit is contained in:
parent
a562d6acdb
commit
289851b20f
@ -8,12 +8,12 @@ import (
|
||||
|
||||
func usage() {
|
||||
fmt.Printf("usage: %v path\n", os.Args[0])
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
func main() {
|
||||
if len(os.Args) != 2 {
|
||||
usage()
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
fmt.Println(path.Dir(os.Args[1]))
|
||||
|
Loading…
Reference in New Issue
Block a user