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
When I import "github.com/containerd/containerd/api/runtime/v2/task" from my local go program, I encounter the following build error.
main.go:6:2: no required module provides package github.com/containerd/containerd/api/runtime/v2/task; to add it:
go get github.com/containerd/containerd/api/runtime/v2/task
Then, go get github.com/containerd/containerd/api/runtime/v2/task shows the following error.
go: module github.com/containerd/containerd/api@upgrade found (v1.6.0-beta.3), but does not contain package github.com/containerd/containerd/api/runtime/v2/task
go mod tidy also shows a similar error as described later.
The api package was a Go module at v1.6.0-beta.3, and the resository has a git tag api/v1.6.0-beta.3, but the api package is not a Go module at v1.7.2, since go.mod has been remove from the api directory.
I guess that go get command first tries to find the latest version of api module, and finds the git tag api/v1.6.0-beta.3, but the old api module does not include the task directory, which was introduced in the later version.
Steps to reproduce the issue
Prepare go.mod
go mod init
go get github.com/containerd/containerd/[email protected]
Create a main.go as follows in an empty directory.
package main
import (
"fmt"
task "github.com/containerd/containerd/api/runtime/v2"
)
func main() {
var t task.TaskService
fmt.Println(t)
}
go: finding module for package github.com/containerd/containerd/api/runtime/v2/task
test imports
github.com/containerd/containerd/api/runtime/v2/task: module github.com/containerd/containerd/api@latest found (v1.6.0-beta.3), but does not contain package github.com/containerd/containerd/api/runtime/v2/task
Expected result
go mod tidy update go.mod successfully.
What version of containerd are you using?
v1.7.2
Any other relevant information
Go version: go1.20.3 darwin/arm64
Show configuration if it is related to CRI plugin.
No response
The text was updated successfully, but these errors were encountered:
Description
When I import "github.com/containerd/containerd/api/runtime/v2/task" from my local go program, I encounter the following build error.
Then,
go get github.com/containerd/containerd/api/runtime/v2/task
shows the following error.go mod tidy
also shows a similar error as described later.The
api
package was a Go module at v1.6.0-beta.3, and the resository has a git tagapi/v1.6.0-beta.3
, but theapi
package is not a Go module at v1.7.2, sincego.mod
has been remove from theapi
directory.I guess that
go get
command first tries to find the latest version ofapi
module, and finds the git tagapi/v1.6.0-beta.3
, but the oldapi
module does not include thetask
directory, which was introduced in the later version.Steps to reproduce the issue
go.mod
main.go
as follows in an empty directory.go.mod
Go Playground: https://go.dev/play/p/bGaR1VvTlT1
Describe the results you received and expected
received result
go mod tidy
returns the following error.Expected result
go mod tidy
updatego.mod
successfully.What version of containerd are you using?
v1.7.2
Any other relevant information
Go version: go1.20.3 darwin/arm64
Show configuration if it is related to CRI plugin.
No response
The text was updated successfully, but these errors were encountered: