字符串切片到字符串?

I'm writing a program that takes normal flags and a single "non-flag" argument, like this:

my-prog -level 1 map.txt

To process map.txt I use flag.Args()[:1], but if you pass that to functions that takes a string, this compiler error appears:

cannot use flag.Args()[:1] (type []string) as type string in assignment

How can I convert flag.Args()[:1] to a string?

Index the first string instead of slicing it: flag.Args()[0]

Or you can use the flag.Arg(0) function to get the first argument only.