jszwec / csvutil

csvutil provides fast and idiomatic mapping between CSV and Go (golang) values.
MIT License
944 stars 62 forks source link

Read file without defining a struct beforehand, such as into a `[]map[string]string`? #60

Closed FrankDMartinez closed 1 year ago

FrankDMartinez commented 1 year ago

Hi.

I hope you are having a great new year so far.

If I wanted to read a CSV file into a []map[string]string using this library, how would I do so?

Thanks in advance.

jszwec commented 1 year ago

This is not supported. This package encodes/decodes only struct values and I have no plans on adding maps support.

However, check Unmarshal and metadata section in README. You can turn it into a helper function that will give you what you need