我比较陌生,我在 go build 系统上遇到了一些问题。
GO环境:
(base) ngadre-mbp:github.com ngadre$ go version
go version go1.14.5 darwin/amd64
(base) ngadre-mbp:github.com ngadre$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/ngadre/Library/Caches/go-build"
GOENV="/Users/ngadre/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/ngadre/Desktop/Workspace/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/5g/59l0__050lg6p4hv1wv7mhw40000gn/T/go-build110012391=/tmp/go-build -gno-record-gcc-switches -fno-common"
我的目录结构如下:
pwd: /Users/ngadre/Desktop/Workspace/go/src/github.com
.
├── coredhcp
│ ├── LICENSE
│ ├── README.md
│ ├── cmds
│ │ ├── client
│ │ ├── coredhcp
│ │ └── coredhcp-generator
│ ├── config
│ │ ├── config.go
│ │ ├── config_test.go
│ │ └── errors.go
│ ├── go.mod
│ ├── go.sum
│ ├── handler
│ │ └── handler.go
│ ├── logger
│ │ └── logger.go
│ ├── plugins
│ │ ├── dns
│ │ ├── example
│ │ ├── file
│ │ ├── leasetime
│ │ ├── nbp
│ │ ├── netmask
│ │ ├── plugin.go
│ │ ├── range
│ │ ├── router
│ │ └── serverid
│ └── server
│ ├── handle.go
│ └── serve.go
├── go-immutable-radix
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── edges.go
│ ├── go.mod
│ ├── go.sum
│ ├── iradix.go
│ ├── iradix_test.go
│ ├── iter.go
│ ├── node.go
│ └── raw_iter.go
我使用克隆的项目“ coredhcp ”和“ go-immutable-radix ”git clone
我对“ go-immutable-radix ”项目进行了一些更改并添加了日志,但是,我无法将本地更改构建到使用此“ go-immutable-radix ”项目的“ coredhcp ”项目中。
go build cmds/coredhcp/main.go
关于如何通过 go build 将“A”项目中的本地更改编译为“X”项目的任何建议。