Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

v2 version from the code should be removed #241

Closed
mkumatag opened this issue Aug 2, 2019 · 4 comments
Closed

v2 version from the code should be removed #241

mkumatag opened this issue Aug 2, 2019 · 4 comments

Comments

@mkumatag
Copy link
Contributor

mkumatag commented Aug 2, 2019

The specific version(e.g: github.com/AlecAivazis/survey/v2/core, github.com/AlecAivazis/survey/v2/terminal) in the pkg import path usually used when the package is intentionally referring to some other version(usually used for importing the features from the previous version for the special use case like package backward compatibility etc..).

In survey usecase, I don't see a point of having a version in the import path, hence need to be removed from all the root and test files.

@AlecAivazis
Copy link
Owner

I appreciate your post. We added the v2 to the path when we broke the API. I'm going to keep it as it is for now so that we don't break people's worlds

@mkumatag
Copy link
Contributor Author

mkumatag commented Aug 2, 2019

I appreciate your post. We added the v2 to the path when we broke the API. I'm going to keep it as it is for now so that we don't break people's worlds

Well, this is creating an issue while vendoring the code via dep tool etc.. The current v2 format can be vendored only via go mod which is not widely used yet.

This impacts all the user who is using package and trying to bump the version via dep tool.

e.g:

$ pwd
/Users/manjunath/survey_ws/src/github.com/mkumatag

$ more example.go
package main

import (
        "fmt"
        "github.com/AlecAivazis/survey/v2"
)

// the questions to ask
var qs = []*survey.Question{
....
.....

$ dep init
init failed: unable to solve the dependency graph: Solving failure: No versions of github.com/AlecAivazis/survey met constraints:
	v2.0.2: Could not introduce github.com/AlecAivazis/survey@v2.0.2, as its subpackage github.com/AlecAivazis/survey/v2 is missing. (Package is required by (root).)
	v2.0.1: Could not introduce github.com/AlecAivazis/survey@v2.0.1, as its subpackage github.com/AlecAivazis/survey/v2 is missing. (Package is required by (root).)
	v2.0.0: Could not introduce github.com/AlecAivazis/survey@v2.0.0, as its subpackage github.com/AlecAivazis/survey/v2 is missing. (Package is required by (root).)
	v1.8.5: Could not introduce github.com/AlecAivazis/survey@v1.8.5, as its subpackage github.com/AlecAivazis/survey/v2 is missing. (Package is required by (root).)
	v1.8.4: Could not introduce github.com/AlecAivazis/survey@v1.8.4, as its subpackage github.com/AlecAivazis/survey/v2 is missing. (Package is required by (root).)
	v1.8.3: Could not introduce github.com/AlecAivazis/survey@v1.8.3, as its subpackage github.com/AlecAivazis/survey/v2 is missing. (Package is required by (root).)
	v1.8.2: Could not introduce github.com/AlecAivazis/survey@v1.8.2, as its subpackage github.com/AlecAivazis/survey/v2 is missing. (Package is required by (root).)
	v1.8.1: Could not introduce github.com/AlecAivazis/survey@v1.8.1, as its subpackage github.com/AlecAivazis/survey/v2 is missing. (Package is required by (root).)
	v1.8.0: Could not introduce github.com/AlecAivazis/survey@v1.8.0, as its subpackage github.com/AlecAivazis/survey/v2 is missing. (Package is required by (root).)
	v1.8: Could not introduce github.com/AlecAivazis/survey@v1.8, as its subpackage github.com/AlecAivazis/survey/v2 is missing. (Package is required by (root).)
	v1.7.1: Could not introduce github.com/AlecAivazis/survey@v1.7.1, as its subpackage github.com/AlecAivazis/survey/v2 is missing. (Package is required by (root).)
....
....

Let me know if you have any suggestion to update the package via dep tool

@chappjc
Copy link
Contributor

chappjc commented Aug 15, 2019

@mkumatag I suggest you migrate from dep to go modules. The version suffix in import paths is here to stay in the entire Go community.

@mkumatag
Copy link
Contributor Author

@mkumatag I suggest you migrate from dep to go modules. The version suffix in import paths is here to stay in the entire Go community.

yes, that is what I'm trying to do.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants