You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support to obs-service-go_modules for vendoring with upstream projects using workspaces. When a Go project has a workspace go.work and go.work.sum committed to git, go mod vendor will fail with error:
go mod vendor
go: 'go mod vendor' cannot be run in workspace mode.
Run 'go work vendor' to vendor the workspace or set 'GOWORK=off' to exit workspace mode.
When following the recommendation GOWORK=off, the go.sum committed to git may be incomplete otherwise out of sync if developers are routinely using only the workspace when building:
go-tpm-tools> GOWORK=off go mod vendor
go: github.com/google/go-tpm-tools/internal/util imports
cloud.google.com/go/compute/metadata:
missing go.sum entry for module providing package cloud.google.com/go/compute/metadata
(imported by github.com/google/go-tpm-tools/internal/util); to add:
go get github.com/google/go-tpm-tools/internal/util
go: github.com/google/go-tpm-tools/internal/util imports
github.com/golang-jwt/jwt/v4:
no required module provides package github.com/golang-jwt/jwt/v4; to add it:
go get github.com/golang-jwt/jwt/v4
go: github.com/google/go-tpm-tools/internal/util imports
golang.org/x/net/http2:
missing go.sum entry for module providing package golang.org/x/net/http2
(imported by github.com/google/go-tpm-tools/internal/util); to add:
go get github.com/google/go-tpm-tools/internal/util
...
Research additional upstream projects with committed workspaces and document whether a standard sequence of go mod operations that can be used to reliably vendor such projects. If no single standard sequence is possible, logic can be built into the service implementation to detect and do the right thing for known layouts as encountered.
The text was updated successfully, but these errors were encountered:
jfkw
changed the title
Support vendoring Go projects that have a committed go.work that assumes workspace mode
Support vendoring Go projects with a committed go.work that assumes workspace mode
Apr 15, 2024
Add support to
obs-service-go_modules
for vendoring with upstream projects using workspaces. When a Go project has a workspacego.work
andgo.work.sum
committed to git,go mod vendor
will fail with error:When following the recommendation
GOWORK=off
, thego.sum
committed to git may be incomplete otherwise out of sync if developers are routinely using only the workspace when building:Research additional upstream projects with committed workspaces and document whether a standard sequence of
go mod
operations that can be used to reliably vendor such projects. If no single standard sequence is possible, logic can be built into the service implementation to detect and do the right thing for known layouts as encountered.The text was updated successfully, but these errors were encountered: