Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

[WIP] Fall back to 'sort.Slice' on Go 1.7 where 'sort.SliceStable' does not exist #1968

Closed
wants to merge 1 commit into from

Conversation

HaraldNordgren
Copy link
Member

@HaraldNordgren HaraldNordgren commented Jul 28, 2018

Note to self: Please edit CHANGELOG.md and add the change under the appropriate category (NEW FEATURES, IMPROVEMENTS & BUG FIXES) along with the PR number.

fixes #1967

@sdboyer
Copy link
Member

sdboyer commented Jul 30, 2018

The semantics here aren't exactly equivalent, but i have to look more deeply to remind myself of why we used sort.SliceStable() in the first place to be sure of the effects.

Is this actually the only thing that prevents dep from compiling on Go 1.7?

@HaraldNordgren
Copy link
Member Author

HaraldNordgren commented Aug 6, 2018

@sdboyer Actually, I realized a few things after putting this together:

  1. sort.Slice doesn't exist either on 1.7. So calling that is not actually a solution. The reason the tests are not failing is that they currently only run for >=1.9. If we want to implement support for older Go versions then we could copy the definition of func SliceStable(slice interface{}, less func(i, j int) bool) into sort_pre_go_1_8.go. Its implementation has remained the same since Go 1.8.

  2. Like I wrote in Dep installation fails on Go version 1.7.x #1967, likeIy a better way to install Dep between Go versions (e.g. on Travis) is to just call curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh. So possibly that also eliminates the need to expand the backward compatibility for the source code.

@jmank88
Copy link
Collaborator

jmank88 commented Aug 24, 2018

Is this actually the only thing that prevents dep from compiling on Go 1.7?

For reference, dropping 1.7: #714 and 1.8: #1620

@HaraldNordgren HaraldNordgren deleted the unbreak_go_1.7 branch September 12, 2018 15:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dep installation fails on Go version 1.7.x
4 participants