This repository was archived by the owner on Sep 9, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +28
-4
lines changed Expand file tree Collapse file tree 4 files changed +28
-4
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ package gps
66
77import (
88 "fmt"
9- "sort"
109
1110 "github.com/Masterminds/semver"
1211 "github.com/golang/dep/gps/internal/pb"
@@ -375,7 +374,7 @@ func (m ProjectConstraints) overrideAll(pcm ProjectConstraints) (out []workingCo
375374 k ++
376375 }
377376
378- sort . SliceStable (out , func (i , j int ) bool {
377+ sortSlice (out , func (i , j int ) bool {
379378 return out [i ].Ident .Less (out [j ].Ident )
380379 })
381380 return
Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ package gps
66
77import (
88 "reflect"
9- "sort"
109 "testing"
1110)
1211
@@ -21,7 +20,7 @@ func TestLockedProjectSorting(t *testing.T) {
2120 lps2 := make ([]LockedProject , len (lps ))
2221 copy (lps2 , lps )
2322
24- sort . SliceStable (lps2 , func (i , j int ) bool {
23+ sortSlice (lps2 , func (i , j int ) bool {
2524 return lps2 [i ].Ident ().Less (lps2 [j ].Ident ())
2625 })
2726
Original file line number Diff line number Diff line change 1+ // Copyright 2018 The Go Authors. All rights reserved.
2+ // Use of this source code is governed by a BSD-style
3+ // license that can be found in the LICENSE file.
4+
5+ // +build go1.8
6+
7+ package gps
8+
9+ import "sort"
10+
11+ func sortSlice (slice interface {}, less func (i , j int ) bool ) {
12+ sort .SliceStable (slice , less )
13+ }
Original file line number Diff line number Diff line change 1+ // Copyright 2018 The Go Authors. All rights reserved.
2+ // Use of this source code is governed by a BSD-style
3+ // license that can be found in the LICENSE file.
4+
5+ // +build !go1.8
6+
7+ package gps
8+
9+ import "sort"
10+
11+ func sortSlice (slice interface {}, less func (i , j int ) bool ) {
12+ sort .Slice (slice , less )
13+ }
You can’t perform that action at this time.
0 commit comments