I saw a piece of code used to print values passed in arguments:
package main
import "fmt"
import "os"
func main() {
for _, val := range os.Args[1:] {
fmt.Printf("%d %s \n", _ , val)
}
}
Original program had a note that _
holds index but was not printing it. When I tried to print index, I am getting below error:
./main.go:8:16: cannot use _ as value
What is the issue here?