Skip to content

Conversation

@maruel
Copy link
Contributor

@maruel maruel commented Aug 19, 2015

Implements a new function less() to compare two map key value. Include 92% of
test coverage of this function.

The missing part is comparing struct but it's impossible to use struct as map key so it is not a big deal.

@cee-dub
Copy link
Collaborator

cee-dub commented Aug 20, 2015

Thanks for the PR, especially including the tests!

It is quite possible to use structs as a map key. See "Key types" in the article here: https://blog.golang.org/go-maps-in-action

udondan and others added 6 commits May 6, 2019 17:47
It's enough to declare and assign it when we actually
need it a couple of lines below.
Currently the documentation for github.com/kr/pretty is not displayed on
pkg.go.dev because of license restrictions:

    https://pkg.go.dev/github.com/kr/pretty?tab=doc

This is almost certainly because the License file includes an errant
header:

    The MIT License (MIT)

The actual MIT license does not include this header:

    https://opensource.org/licenses/MIT

GitHub and other interfaces surface the type of the license through
automatic detection (as will pkg.go.dev). Hence this header is
superfluous in any case.

Whilst we are at it, tidy up go.mod and add go.sum.
See golang/go#32479

Fix kr#65.

Signed-off-by: Robert-André Mauchin <zebob.m@gmail.com>
This prevents infinite recursion, similar to the fixes to the formatter
in kr#13.  In addition to detecting cycles, we also check that the two
values contain the same cyclic structure.
Implements a new function less() to compare two map key value. Include 92% of
test coverage of this function.
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.

7 participants