latest
This commit is contained in:
parent
368fb6407d
commit
8f7b3f8d9c
|
@ -0,0 +1,5 @@
|
|||
# installation
|
||||
|
||||
```
|
||||
go install sneak.berlin/go/field@latest
|
||||
```
|
4
main.go
4
main.go
|
@ -10,13 +10,13 @@ import (
|
|||
|
||||
func main() {
|
||||
if len(os.Args) < 2 {
|
||||
fmt.Fprintf(os.Stderr, "usage: %s <field-number>", os.Args[0])
|
||||
fmt.Fprintf(os.Stderr, "usage: %s <field-number>\n", os.Args[0])
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
fieldNum, err := strconv.Atoi(os.Args[1])
|
||||
if err != nil || fieldNum < 1 {
|
||||
fmt.Fprintln(os.Stderr, "invalid field number:", os.Args[1])
|
||||
fmt.Fprintln(os.Stderr, "error: invalid field number")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue