proposal: Support simple code that contain 3rd package in go run
rather than need a go.mod
#61788
Labels
Milestone
go run
rather than need a go.mod
#61788
eg: any simple code that's only few lines and a single file like:
go run test.go
will get "test.go:7:2: no required module provides package github.com/gin-gonic/gin: go.mod file not found in current directory or any parent directory; see 'go help modules'", which is technically correct in the current latest version.But what about adding the default package searching paths including the two folders more: the $goroot and the current folder, to make those single .go files with simple codes that have 1 or 2 3rd party packages could run without any problem? (it currently can run when only the std libs.)
The change affected things may be:
go run test.go # this one currently will only work if only using std libs.
go get "github.com/gin-gonic/gin" # this one currently will complain like "... outside go mod..." and refuse work.
The text was updated successfully, but these errors were encountered: