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
I'm running a go program that imports a third-party package. When I execute, the program execution fails with the following error: main.go:7:2: no required module provides package github.com/goinaction/code/chapter2/sample/matchers: go.mod file not found in current directory or any parent directory; see 'go help modules'
I'm sure the go.mod file exists in the current directory, as shown in the image below:
The command what I excute is go run ./main.go go mod tidy or go mod init is helpless.
environment:wsl2+ubuntu22.04
What version of Go are you using (go version)?
$ go version
go version go1.20.3 linux/amd64
Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (go env)?
main.go:7:2: no required module provides package github.com/goinaction/code/chapter2/sample/matchers: go.mod file not found in current directory or any parent directory; see 'go help modules'
The text was updated successfully, but these errors were encountered:
Please don't use screenshots, they're hard to read.
This isn't enough information for us to diagnose any issue, notably missing are the contents of files (and they diverge from the repo you've cloned), the exact commands including where you ran them. Your bug report data also doesn't match the situation you've described.
Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.
I'm running a go program that imports a third-party package. When I execute, the program execution fails with the following error:
main.go:7:2: no required module provides package github.com/goinaction/code/chapter2/sample/matchers: go.mod file not found in current directory or any parent directory; see 'go help modules'
I'm sure the go.mod file exists in the current directory, as shown in the image below:
The command what I excute is
go run ./main.go
go mod tidy
orgo mod init
is helpless.environment:wsl2+ubuntu22.04
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
The program executes normally
What did you see instead?
main.go:7:2: no required module provides package github.com/goinaction/code/chapter2/sample/matchers: go.mod file not found in current directory or any parent directory; see 'go help modules'
The text was updated successfully, but these errors were encountered: