hashicorp / go-multierror

A Go (golang) package for representing a list of errors as a single error.
Mozilla Public License 2.0
2.34k stars 124 forks source link

Marshalling multierror #3

Closed malpiatko closed 6 years ago

malpiatko commented 8 years ago

Hey,

I am using your multierror package in my project however I need to wrap it and add a MarshalJSON as it doesn't Marshal out of the box (because of the Func field). Would it be ok to add it to your project? In my case it would just marshal the error array. I don't know if you would want to do something more elaborate

mitchellh commented 8 years ago

Sounds good to me. I commented on your PR, if we can unmarshal then I think its fine!

malpiatko commented 8 years ago

I changed the code and answered your suggestions :)

ConradIrwin commented 7 years ago

@mitchellh Another attempt here: https://github.com/hashicorp/go-multierror/pull/15

The problem I was trying to solve was just that it fails, but adding a round-trip does seem kind of handy, so done.