What is Golang\'s equivalent of the below python commands ?
import argparse
parser = argparse.ArgumentParser(description=\"something\")
parser.add_argument(\
You can at least have a list of arguments on the end of you command by using the flag.Args() function.
package main
import (
"flag"
"fmt"
)
var one string
func main() {
flag.StringVar(&one, "o", "default", "arg one")
flag.Parse()
tail := flag.Args()
fmt.Printf("Tail: %+q\n", tail)
}
my-go-app -o 1 this is the rest
will print Tail: ["this" "is" "the" "rest"]