Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
2ccd4e9f
Commit
2ccd4e9f
authored
Feb 01, 2013
by
Brad Fitzpatrick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sort: delete now-duplicate example, fix build
R=golang-dev, minux.ma CC=golang-dev
https://golang.org/cl/7220075
parent
d4cfe288
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
30 deletions
+0
-30
src/pkg/sort/example_reverse_test.go
src/pkg/sort/example_reverse_test.go
+0
-30
No files found.
src/pkg/sort/example_reverse_test.go
deleted
100644 → 0
View file @
d4cfe288
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package
sort_test
import
(
"fmt"
"sort"
)
// Reverse embeds a sort.Interface value and implements a reverse sort over
// that value.
type
Reverse
struct
{
// This embedded Interface permits Reverse to use the methods of
// another Interface implementation.
sort
.
Interface
}
// Less returns the opposite of the embedded implementation's Less method.
func
(
r
Reverse
)
Less
(
i
,
j
int
)
bool
{
return
r
.
Interface
.
Less
(
j
,
i
)
}
func
ExampleInterface_reverse
()
{
s
:=
[]
int
{
5
,
2
,
6
,
3
,
1
,
4
}
// unsorted
sort
.
Sort
(
Reverse
{
sort
.
IntSlice
(
s
)})
fmt
.
Println
(
s
)
// Output: [6 5 4 3 2 1]
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment