Golang: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 9: | Line 9: | ||
go mod init | go mod init | ||
go mod vendor | go mod vendor | ||
go get github.com/RangelReale/osin | |||
go get github.com/pborman/uuid | |||
go run . | go run . | ||
Line 24: | Line 26: | ||
GOROOT="/usr/lib/go" | GOROOT="/usr/lib/go" | ||
GOPATH="/root/go" | GOPATH="/root/go" | ||
hack/lib/build/binaries.sh | hack/lib/build/binaries.sh | ||
OS_EXTRA_GOPATH=$GOPATH | OS_EXTRA_GOPATH=$GOPATH | ||
make build | <nowiki>make build | ||
hack/build-go.sh | hack/build-go.sh | ||
hack/lib/build/binaries.sh | hack/lib/build/binaries.sh | ||
228: `GOOS=${platform%/*} GOARCH=${platform##*/} go install -pkgdir "${OS_OUTPUT_PKGDIR}/${platform}" -tags "${OS_GOFLAGS_TAGS-} ${!platform_gotags_envvar:-}" -ldflags="${local_ldflags}" "${goflags[@]:+${goflags[@]}}" "${nonstatics[@]}"` | 228: `GOOS=${platform%/*} GOARCH=${platform##*/} go install -pkgdir "${OS_OUTPUT_PKGDIR}/${platform}" -tags "${OS_GOFLAGS_TAGS-} ${!platform_gotags_envvar:-}" -ldflags="${local_ldflags}" "${goflags[@]:+${goflags[@]}}" "${nonstatics[@]}"`</nowiki> | ||
https://github.com/golang/go/wiki/GOPATH | https://github.com/golang/go/wiki/GOPATH |
Revision as of 09:26, 13 February 2024
https://github.com/go-modules-by-example/index/blob/master/008_vendor_example/README.md
go version go mod init janmg.com/blob-to-queue go clean -modcache go mod tidy go run blob-to-queue.go config.go blob.go nsgflowlogs.go azure-eventhub.go kafka.go
go mod init go mod vendor go get github.com/RangelReale/osin go get github.com/pborman/uuid go run .
./vendor/ $GOROOT $GOPATH
src,pkg,bin
cat /etc/profile.d/go.sh export GOPATH=$HOME/go export PATH=$PATH:$GOPATH/bin export OS_OUTPUT_GOPATH=0
GOROOT="/usr/lib/go" GOPATH="/root/go"
hack/lib/build/binaries.sh OS_EXTRA_GOPATH=$GOPATH
make build hack/build-go.sh hack/lib/build/binaries.sh 228: `GOOS=${platform%/*} GOARCH=${platform##*/} go install -pkgdir "${OS_OUTPUT_PKGDIR}/${platform}" -tags "${OS_GOFLAGS_TAGS-} ${!platform_gotags_envvar:-}" -ldflags="${local_ldflags}" "${goflags[@]:+${goflags[@]}}" "${nonstatics[@]}"`
https://github.com/golang/go/wiki/GOPATH https://github.com/golang/go/issues/17262
go env export $GOPATH=$HOME/go hack/env OS_OUTPUT_GOPATH
./_output/local/pkgdir/linux/amd64/github.com/openshift/origin/vendor/github.com/RangelReale/osin.a cp /root/go/pkg/linux_amd64/github.com/RangelReale/osin.a ./_output/local/pkgdir/linux/amd64/github.com/openshift/origin/vendor/github.com/RangelReale/osin.a
Godeps/Godeps.json
"github.com/RangelReale/osin"
cd /usr/src/origin; /root/go/bin/godep restore
perl -pi -w -e 's/\"github.com\/RangelReale\/osin\"/\"github.com\/janmg\/osin\"/g;' $( grep -rl '\"github.com\/RangelReale\/osin\"' )