Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from DEP to GO Modules #46

Merged
merged 1 commit into from
Feb 22, 2019
Merged

Migrate from DEP to GO Modules #46

merged 1 commit into from
Feb 22, 2019

Conversation

aperezg
Copy link
Contributor

@aperezg aperezg commented Jan 10, 2019

Migrate the repository from DEP to the new Go Modules.

Signed-off-by: aperezg [email protected]

@bzz
Copy link

bzz commented Jan 24, 2019

@aperezg thank you for contribution!

JFY - current src-d engineering conventions suggest using Dep for dependency management although migration to modules is widely discussed and the necessity is acknowledged (I presume @smola can elaborate on that if necessary).

As go modules is quite new feature, adding few lines of description on how the migration was made would help to build some confidence and make sure maintainers and @vmarkovtsev understand and may wish to adopt new dependency management workflow.

@aperezg
Copy link
Contributor Author

aperezg commented Jan 24, 2019

@aperezg thank you for contribution!

JFY - current src-d engineering conventions suggest using Dep for dependency management although migration to modules is widely discussed and the necessity is acknowledged (I presume @smola can elaborate on that if necessary).

As go modules is quite new feature, adding few lines of description on how the migration was made would help to build some confidence and make sure maintainers and @vmarkovtsev understand and may wish to adopt new dependency management workflow.

@bzz thank you for your explanation, I understand that actually src-d is working with Dep and the "Go Modules" are a relative newly feature.

I decided to migrate this repository for only formative purpose, I've got a Go community with a partner in Spain, and we recently talk about "Go Modules". The src-d company is a company that we like it, and that's the reason why we think that we can migrate one of their libraries to "Go Modules" and there here is hehehe.

Well, the workflow that I followed to migrate the library was the next.

First of all I checked the application working from scratch.

go test ./...

And

go run cmd/license-detector/main.go https://github.com/friendsofgo/graphiql

Then when I realized that all working fine, with standard configuration, I began with the migration:

go mod init

With this command, the go.mod file with the dependencies from Gopkg.toml was created.

Then I executed

go mod tidy

Now I had the go.mod and go.sum with all neccessary dependencies of the projects, even the test dependencies.

Now I needed to check that all continues working, for that purpose I remove the unneccessary files

rm -rf Gopkg.toml Gopkg.lock vendor

And then I executed the tests again

go test ./...

And

go run cmd/license-detector/main.go https://github.com/friendsofgo/graphiql

When I checked that, the output was the expected, I launched one more command

go mod vendor

To keep it working the other (older) dependency managers.

And that's all! I understand that this PR may not to be merged, but it was a pleasure collaborate with you.

@bzz bzz requested review from vmarkovtsev and campoy February 22, 2019 15:50
@vmarkovtsev
Copy link
Collaborator

I have never used modules, but I guess if we have some problems in the future I will be able to fix them. Thanks @aperezg

@vmarkovtsev vmarkovtsev merged commit 9f8957e into src-d:master Feb 22, 2019
@aperezg aperezg deleted the migrate_to_go_modules branch March 4, 2019 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants