Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: diff sections don't maintain the order given by the server #86

Closed
BrunoRosendo opened this issue Aug 19, 2022 · 0 comments · Fixed by #87
Closed

cli: diff sections don't maintain the order given by the server #86

BrunoRosendo opened this issue Aug 19, 2022 · 0 comments · Fixed by #87
Assignees
Labels

Comments

@BrunoRosendo
Copy link
Member

This happens because, in contrary to Python's dictionaries, GO's maps are not ordered.

Here's an example:

$ reana-client diff events.1 test | grep "^==>"
==> Differences in workflow inputs
==> Differences in workflow outputs
==> Differences in workflow version
==> Differences in workflow workspace
==> Differences in workflow specification
==> Differences in workflow workspace

$ $ ./reana-client-go diff events.1 test | grep "==>"
==> Differences in workflow specification
==> Differences in workflow inputs
==> Differences in workflow outputs
==> Differences in workflow version
==> Differences in workflow workspace
==> Differences in workflow workspace

This problem was discussed in this comment: #82 (comment)
Some possible solutions include using json.Decoder to decode the JSON object manually, or use a library like orderedmap to ensure the order is maintained.

@BrunoRosendo BrunoRosendo self-assigned this Aug 19, 2022
BrunoRosendo added a commit to BrunoRosendo/reana-client-go that referenced this issue Aug 19, 2022
BrunoRosendo added a commit to BrunoRosendo/reana-client-go that referenced this issue Aug 19, 2022
BrunoRosendo added a commit to BrunoRosendo/reana-client-go that referenced this issue Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant