This question already has an answer here:
My Program:
package main
import (
"log"
"os"
)
func main() {
inputs := os.Args[1:]
log.Print(inputs)
}
When run with the command
go run filename.go 3001-3005 1->A,2->B,3->C,4->D,5->E
gives the output as [3001-3005 1-,2-,3-,4-,5-]
instead of [3001-3005 1->A,2->B,3->C,4->D,5->E]
</div>
The ">" characters on your command line are being interpreted as redirections meaning "send output to a file rather than to the console".
You should be able to stop this happening by quoting the command-line arguments in question. Exactly how you should do this depends on what OS you're on, what shell you're using if you're on a Unix-like OS, etc, but I would try putting double-quotes around that second argument, like this:
go run filename.go 3001-3005 "1->A,2->B,3->C,4->D,5->E"