1
0
mirror of https://github.com/rancher/types.git synced 2025-08-25 15:28:24 +00:00

Merge pull request #1096 from brendarearden/update-readme

Add gopath details to readme
This commit is contained in:
Dax McDonald 2020-02-19 13:44:17 -07:00 committed by GitHub
commit 26b7145e8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,13 +14,27 @@ Run `go generate` in the root of the project
### Running code generation after go modules
The code generation code still depends on the GOPATH.
To generate types you need to update vendor.
To generate types you need to update vendor.
1. Ensure your types project is where your current PWD is set up like a gopath.
`<dir>/src/github.com/rancher/types`
Example:
`/Users/<yourusername>/work/types/src/github.com/rancher/types` or
`/Users/<yourusername>/go/src/github.com/rancher/types`
2. Update go.mod for what you need
3. Run `GO111MODULE=on go mod vendor`
4. Export your types gopath directory
`export GOPATH=<dir>`
Example:
`export GOPATH=/Users/<yourusername>/work/types` or
`export GOPATH=/Users/<yourusername>/go`
5. Run `GO111MODULE=off go generate`
6. Run `unset GOPATH`
1. Update go.mod for what you need
2. Run `GO111MODULE=on go mod vendor`
3. Export your gopath (export GOPATH=types_go_path_dir)
4. Run `GO111MODULE=off go generate`
5. Unset your `GOPATH`
## License
Copyright (c) 2014-2017 [Rancher Labs, Inc.](http://rancher.com)