我正在嘗試映射死的簡單yaml配置文件,以使用此軟件包進行結構,但沒有成功。config.yamlDrivers: - "/Volumes/V1" - "/Volumes/V2"去type Iconfig struct { Drivers []string `yaml:"Drivers,flow"`}iconfig := Iconfig{}uerr := yaml.UnmarshalStrict(config_yaml, iconfig)uerr:panic: reflect: reflect.Value.Set using unaddressable value [recovered] panic: reflect: reflect.Value.Set using unaddressable valuefmt.Println(string(config_yaml)):Drivers: - "/Volumes/V1" - "/Volumes/V2"為什么“/Volumes/V1”被認為是不可尋址的值?
- 1 回答
- 0 關注
- 161 瀏覽
添加回答
舉報
0/150
提交
取消