Lauris BH
Lauris BH
Something like https://github.com/elliotchance/orderedmap can be used instead of map
At least with this library elements can be looped in order elements were added to map with code: ```go for el := m.Front(); el != nil; el = el.Next() {...
Looked a bit into this but problem is that it affects a lot of public API where maps are used to pass around mutations that are of type `map[string]Mutate` so...
I could create new `type Mutates struct { .. }` that could be used in place of `map[string]Mutate`
problem is how would you initialize them them when currently everywhere map[string]Mutate is used in API?
yes that was my proposal to change `map[string]Mutate` to `Mutates` in interfaces and expose only needed functionality with type functions and hide underlying storage structure
Also why do you avoid using pointers in interfaces? (`Query` vs `*Query`). Passing it by value does impact allocation count imho
I was thinking something like: ```go func NewMutates(mutates ...Mutate) Mutates type Mutates struct { ... } func (m *Mutates) Add(mutate Mutate) func (m *Mutates) List() []Mutate ``` probably other functions...
Yes `Mutation` can also be reused for this. Just field `Mutates` needs to be made private and different type not map
Only it's that it does duplicate values passed around as fields from `Mutation` are first preprocessed and split to multiple fields that are passed to adapter functions, that would make...