Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1184)

Issue 7376058: code review 7376058: sort: add an example showing sorting struct by differen... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years ago by r
Modified:
12 years ago
Reviewers:
adg, mtj1
CC:
golang-dev, dsymonds
Visibility:
Public.

Description

sort: add an example showing sorting struct by different keys

Patch Set 1 #

Patch Set 2 : diff -r c28d9e5f42ff https://code.google.com/p/go #

Total comments: 1

Patch Set 3 : diff -r c28d9e5f42ff https://code.google.com/p/go #

Patch Set 4 : diff -r 1e891021e069 https://go.googlecode.com/hg/ #

Total comments: 2

Patch Set 5 : diff -r faf5a57def8c https://go.googlecode.com/hg/ #

Patch Set 6 : diff -r faf5a57def8c https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+96 lines, -0 lines) Patch
A src/pkg/sort/example_keys_test.go View 1 2 3 4 1 chunk +96 lines, -0 lines 0 comments Download

Messages

Total messages: 22
r
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go
12 years ago (2013-02-26 23:25:39 UTC) #1
r
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com), Please take another look.
12 years ago (2013-02-26 23:40:43 UTC) #2
dsymonds
https://codereview.appspot.com/7376058/diff/3001/src/pkg/sort/example_keys_test.go File src/pkg/sort/example_keys_test.go (right): https://codereview.appspot.com/7376058/diff/3001/src/pkg/sort/example_keys_test.go#newcode49 src/pkg/sort/example_keys_test.go:49: s.planets = planets splitting this setup seems a little ...
12 years ago (2013-02-26 23:45:13 UTC) #3
r
I don't understand your proposal. -rob
12 years ago (2013-02-26 23:47:38 UTC) #4
r
Hello golang-dev@googlegroups.com, dsymonds@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
12 years ago (2013-02-26 23:50:56 UTC) #5
dsymonds
On Wed, Feb 27, 2013 at 10:47 AM, Rob Pike <r@golang.org> wrote: > I don't ...
12 years ago (2013-02-26 23:51:34 UTC) #6
r
That's a lot of boilerplate. I was trying to write something small and pretty. Let ...
12 years ago (2013-02-26 23:52:23 UTC) #7
r
Hello golang-dev@googlegroups.com, dsymonds@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
12 years ago (2013-02-27 00:45:42 UTC) #8
r
I think I semi-independently came up with your approach, and it's slightly more magical but ...
12 years ago (2013-02-27 00:46:43 UTC) #9
dsymonds
LGTM that's nicer.
12 years ago (2013-02-27 01:02:19 UTC) #10
r
*** Submitted as https://code.google.com/p/go/source/detail?r=2bf8d07c14c1 *** sort: add an example showing sorting struct by different keys ...
12 years ago (2013-02-27 01:17:53 UTC) #11
adg
https://codereview.appspot.com/7376058/diff/14001/src/pkg/sort/example_keys_test.go File src/pkg/sort/example_keys_test.go (right): https://codereview.appspot.com/7376058/diff/14001/src/pkg/sort/example_keys_test.go#newcode63 src/pkg/sort/example_keys_test.go:63: // ExampleSortKeys demonstrates a technique for sorting a struct ...
12 years ago (2013-02-27 02:05:20 UTC) #12
r
According to package testing, it must be lower case or godoc will insist it be ...
12 years ago (2013-02-27 02:12:32 UTC) #13
mtj1
Might there be a clever way to chain these for multiple keys? (by X and ...
12 years ago (2013-02-27 02:15:28 UTC) #14
adg
I forgot about that. On 27 February 2013 13:12, Rob Pike <r@golang.org> wrote: > According ...
12 years ago (2013-02-27 02:15:49 UTC) #15
r
On Tue, Feb 26, 2013 at 6:14 PM, Michael Jones <mtj@google.com> wrote: > Might there ...
12 years ago (2013-02-27 04:53:18 UTC) #16
adg
On 27 February 2013 13:14, Michael Jones <mtj@google.com> wrote: > Might there be a clever ...
12 years ago (2013-02-27 04:59:48 UTC) #17
mtj1
Ooh, so that should be in the example. ;-) On Tue, Feb 26, 2013 at ...
12 years ago (2013-02-27 05:04:02 UTC) #18
adg
The dataset doesn't really lend itself to being sorted in multiple dimensions because none of ...
12 years ago (2013-02-27 05:12:58 UTC) #19
r
I'd use a slice of functions, and call the next element of the slice only ...
12 years ago (2013-02-27 07:22:54 UTC) #20
adg
On 27 February 2013 18:22, Rob Pike <r@golang.org> wrote: > the first function claims equality. ...
12 years ago (2013-02-27 21:29:43 UTC) #21
r
12 years ago (2013-02-27 21:31:32 UTC) #22
*a == *b sounds fine to me in this case, but that would work too.

-rob
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b