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

Use github.com/rogpeppe/go-internal/fmtsort for stable map output #67

Merged
merged 1 commit into from Aug 21, 2020

Conversation

myitcv
Copy link
Contributor

@myitcv myitcv commented Aug 20, 2020

github.com/rogpeppe/go-internal factors out an opinionated selection of
internal packages and functionality from the Go standard library. One
such package is fmtsort:

Package fmtsort provides a general stable ordering mechanism for
maps, on behalf of the fmt and text/template packages. It is not
guaranteed to be efficient and works only for types that are valid
map keys.

Use this package to ensure the Formatter output for maps is stable.

Fixes #47

github.com/rogpeppe/go-internal factors out an opinionated selection of
internal packages and functionality from the Go standard library. One
such package is fmtsort:

    Package fmtsort provides a general stable ordering mechanism for
    maps, on behalf of the fmt and text/template packages. It is not
    guaranteed to be efficient and works only for types that are valid
    map keys.

Use this package to ensure the Formatter output for maps is stable.

Fixes kr#47
Copy link
Owner

@kr kr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thank you!

@kr kr merged commit 3630c7d into kr:main Aug 21, 2020
@2opremio 2opremio mentioned this pull request Aug 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow an option for 'deterministic' iteration order for map prints
2 participants