Golang: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 12: | Line 12: | ||
go get github.com/pborman/uuid | go get github.com/pborman/uuid | ||
go run . | go run . | ||
go mod init janmg.com/blob-to-queue | go version | ||
go mod init janmg.com/blob-to-queue | |||
go clean -modcache | go clean -modcache | ||
go mod tidy | |||
go mod tidy | go run blob-to-queue.go config.go blob.go nsgflowlogs.go azure-eventhub.go kafka.go | ||
go env -w CGO_ENABLED=0 | |||
go run blob-to-queue.go config.go blob.go nsgflowlogs.go azure-eventhub.go kafka.go | go mod download | ||
go mod init github.com/Azure/azure-sdk-for-go/sdk/storage/azblob | |||
go env -w CGO_ENABLED=0 | go mod init github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/blockblob | ||
go run blob-to-kafka.go | |||
go mod download | go mod init janmg.com/blob-to-kafka | ||
go mod tidy | |||
go mod init github.com/Azure/azure-sdk-for-go/sdk/storage/azblob | |||
go mod init github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/blockblob | |||
go run blob-to-kafka.go | |||
go mod init janmg.com/blob-to-kafka | |||
go mod tidy | |||
./vendor/ | ./vendor/ |
Revision as of 19:44, 19 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 .
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 env -w CGO_ENABLED=0 go mod download go mod init github.com/Azure/azure-sdk-for-go/sdk/storage/azblob go mod init github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/blockblob go run blob-to-kafka.go go mod init janmg.com/blob-to-kafka go mod tidy
./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\"' )