Your shell is interpreting the
> as IO redirection. The shell opened the file
A as standard output for the command and passed the argument
1- to the command.
Quote the argument to avoid this:
go run app.go "1->A"
I need to accept command line argument to run a Go program in the below format:
go run app.go 1->A
I am using
os.Args. But it only accepts till '1-' . '>A' is being skipped.
Any help to resolve this issue is highly appreciated.