-1
我正在寫一個程序,在正常的標誌和一個「非標誌」的說法,是這樣的:字符串切片到字符串?
my-prog -level 1 map.txt
要處理map.txt
我用flag.Args()[:1]
,但如果你傳遞給函數接收字符串出現此編譯器錯誤:
cannot use flag.Args()[:1] (type []string) as type string in assignment
我怎麼能轉換flag.Args()[:1]
爲字符串?
謝謝。我可以看到,我仍然有很多東西需要學習。 –