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

klaytn package management is migrated from Dep to Go Modules #84

Closed
miloveme opened this issue Jul 29, 2019 · 2 comments
Closed

klaytn package management is migrated from Dep to Go Modules #84

miloveme opened this issue Jul 29, 2019 · 2 comments
Assignees

Comments

@miloveme
Copy link

how about migrate klaytn package management from Dep to Go Moudles

Migration Guide

  1. Run go version and make sure you're using version 11 or later.
  2. Move your code outside of GOPATH or set export GO111MODULE=on.
  3. go mod init [module path]: This will import dependencies from Gopkg.lock.
  4. go mod tidy: This will remove unnecessary imports, and add indirect ones.
  5. rm -rf vendor/: Optional step to delete your vendor folder.
  6. go build: Do a test build to see if it works.
  7. rm -f Gopkg.lock Gopkg.toml: Delete the obsolete files used for Dep.
@kjhman21 kjhman21 self-assigned this Jul 30, 2019
@miloveme
Copy link
Author

In klaytn project, Makefile should be modified to use Go Module
Makefile :
...
build/env.sh go run build/ci.go install ./cmd/kcn
...
all of 'build/env.sh' is removed because Go Module doesn't need go environment

@kjhman21 kjhman21 assigned ehnuje and unassigned kjhman21 Jul 30, 2019
@miloveme
Copy link
Author

If you want to keep your vendor folder:
do not 7 step mentioned and do following step instead of 7 step
7. Run go mod vendor to copy your dependencies into the vendor folder.
8. Run go build -mod=vendor to ensure go build uses your vendor folder.

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

No branches or pull requests

4 participants