Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: go mod tidy in workspace will err like: a.b.c/a: cannot find module providing package #55139

Closed
kirito41dd opened this issue Sep 19, 2022 · 1 comment

Comments

@kirito41dd
Copy link

What version of Go are you using (go version)?

$ go version
go version go1.18 darwin/amd64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOMOD="/Users/xxx/work/testwk/b/go.mod"
GOWORK="/Users/xxx/work/testwk/go.work"

What did you do?

i'm trying to use workspace, my work dir:

testwk/
    a/
        go.mod a.go
    b/
        go.mod main.go
    go.work

go.work:

go 1.18

use (
	./a
	./b
)

a/go.mod:

module a.b.c/a

go 1.18

a/a.go:

package a

var Version = "a"

b/go.mod:

module a.b.c/b

go 1.18

b/main.go:

package main

import (
	"a.b.c/a"
	"fmt"
)

func main() {
	fmt.Println(a.Version)
}

when i use go mod tidy in b/:

➜  b go mod tidy
go: finding module for package a.b.c/a
a.b.c/b imports
        a.b.c/a: cannot find module providing package a.b.c/a: unrecognized import path "a.b.c/a": https fetch: Get "https://a.b.c/a?go-get=1": dial tcp: lookup a.b.c: no such host

This seems to be a bug and should skip the a.b.c/a which in go.work.

@seankhliao
Copy link
Member

Duplicate of #50750

@seankhliao seankhliao marked this as a duplicate of #50750 Sep 19, 2022
@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Sep 19, 2022
@golang golang locked and limited conversation to collaborators Sep 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants