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[1]. But
os.Args[1]
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.
>
A
1-
Quote the argument to avoid this:
go run app.go "1->A"