How to create multiple go projects

for example, if I now have
/ Users/xxx/my-go-1
/ Users/xxx/my-go-2
projects, should I add both to the gopath of .bash _ profile?
so that I have to modify it every time I build a new project. Bash _ profile, feels troublesome

Nov.05,2021

/ Users/xxx/gopath this is regarded as gopath,

/ Users/xxx/gopath/my-go-1
/ Users/xxx/gopath/my-go-2
these two are project addresses, isn't it good?


go mod?


generally gopath is set in makefile


GOPATH sets only one, and then there is this structure. Under the second layer is the project name:

  go tree -L 2 $GOPATH/src
$GOPATH/src
 github.com
  Masterminds
  cweill
  davidrjenni
  tendermint
  uudashr
 golang.org
  x
 gopkg.in
  bsm
  redis.v4
  yaml.v2
 govendor
  LICENSE
  README.md
  appveyor.yml
  cliprompt
  context
  doc
  help
  internal
  main.go
  migrate
  pkgspec
  prompt
  run
  vcs
  vendor
  vendorfile
 sourcegraph.com
     sqs
Menu