From 10fc6efaacbb75c50416781dea0861c2cf44b859 Mon Sep 17 00:00:00 2001 From: Brenda Rearden Date: Wed, 19 Feb 2020 10:47:47 -0700 Subject: [PATCH] Add gopath examples --- README.md | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 8d880d79..ef1f90e9 100644 --- a/README.md +++ b/README.md @@ -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. + + `/src/github.com/rancher/types` + + Example: + `/Users//work/types/src/github.com/rancher/types` or + `/Users//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=` + + Example: + `export GOPATH=/Users//work/types` or + `export GOPATH=/Users//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)