Skip to content

Commit

Permalink
cmd/go: add a test that reproduces #45827
Browse files Browse the repository at this point in the history
For #45827

Change-Id: I4d3268d66fb0927161f44b353faef11aa4551e40
Reviewed-on: https://go-review.googlesource.com/c/go/+/317298
Trust: Bryan C. Mills <[email protected]>
Run-TryBot: Bryan C. Mills <[email protected]>
TryBot-Result: Go Bot <[email protected]>
Reviewed-by: Jay Conrod <[email protected]>
  • Loading branch information
Bryan C. Mills committed May 10, 2021
1 parent e18a8b4 commit a9edda3
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/cmd/go/testdata/script/mod_run_pkgerror.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# https://golang.org/issue/45827: 'go run .' should report the same package
# errors as 'go build'.

! go build
stderr '^found packages m \(m\.go\) and main \(main\.go\) in '$PWD'$'

! go run .
# TODO(#45827): This error should match the above.
stderr '^go run: no packages loaded from \.$'

-- go.mod --
module m

go 1.17
-- m.go --
package m
-- main.go --
package main

0 comments on commit a9edda3

Please sign in to comment.