Skip to content
This repository was archived by the owner on Feb 15, 2023. It is now read-only.

Conversation

@cdauphinee
Copy link

The index struct is currently marshaling to/from "{}", which makes it hard to add diagnostic logging to code that uses it.

This change marshals the index using its internal key; for example:

index1 := batch.NewIndex(1)
index2 := batch.NewIndex(2)
data := map[batch.Index]string {
  index1: "foo",
  index2: "bar",
}

json, _ := json.Marshal(data)

// json before change
{
  "{}": "foo",
  "{}": "bar"
}

// json after change
{
  1: "foo",
  2: "bar"
}

This is currently marshaling to/from "{}", which makes it hard to add
diagnostic logging to code that uses parallel maps with index keys.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants