frictionlessdata / tableschema-go

A Go library for working with Table Schema.
MIT License
46 stars 10 forks source link

Add frictionless data field tags to structs #15

Closed danielfireman closed 7 years ago

danielfireman commented 7 years ago

This will make more flexible to declare structs to encode/decode table rows.

Example:

type MyRow  struct {
   MyName string `tableheader:name`
}

MyName field will be populated with values from the "name" column (header)

For reference:

as27 commented 7 years ago

That idea is great. I don't have so much experience with reflection, but I will try.

danielfireman commented 7 years ago

Awesome! Implementing schema.Decode and schema.Encode was a lot of fun and learning. I had not had much experience with reflection either :smiley:

as27 commented 7 years ago

Just send a PR. It was much easier then expected. So Encode() and Decode() are great implemented. Well done.

danielfireman commented 7 years ago

Just send a PR. It was much easier than expected.

It is great that you could easily implement this feature! Great stuff. Already sent you some suggestions/comments.

So Encode() and Decode() are great implemented. Well done.

I am flattered :see_no_evil: .. Thanks a lot!

danielfireman commented 7 years ago

Super happy to close this issue! This feature greatly improves tableschema-go's usability!