AlecAivazis / survey

A golang library for building interactive and accessible prompts with full support for windows and posix terminals.
MIT License
4.08k stars 350 forks source link

v2 version from the code should be removed #241

Closed mkumatag closed 5 years ago

mkumatag commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

@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 commented 5 years ago

@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.