以上錯誤出現在給 map 變量賦值的時候。
例如:
type AbMap map[string]string var abMap AbMap abMap['a'] = 'b'
使用 map 變量需要使用 make 初始化,然后才能賦值。
type AbMap map[string]string abMap := make(AbMap) abMap['a'] = 'b'
以上錯誤出現在給 map 變量賦值的時候。
例如:
type AbMap map[string]string var abMap AbMap abMap['a'] = 'b'
使用 map 變量需要使用 make 初始化,然后才能賦值。
type AbMap map[string]string abMap := make(AbMap) abMap['a'] = 'b'
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。