go-yaml / yaml

YAML support for the Go language.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to parse nested map[int]int

Pim-Infuzed opened this issue · comments

commented

Hi,

I'm parsing my structure into a map[string]interface{} (as of v3 now, as I was using v2 which requires map[interface{}]interface{}).
Example of a structure I want to parse:
type: radiation-powercurve source: name: Interpolations field: Q tags: location: De Klomp target: field: kW curve: 0:0 15:-63 30:-126 45:-189
The problem is dat 'curve' is interpreted by gopkg.in/yaml as a string containing all the listed elements instead of a map.
This happens with v2 and also with v3.
Is there a way to let the unmarshaller detect this should be interpreted as a map (not parsing to structs)?