The straight revert in CL 551215 fixed this issue.
Add a test case to make sure we don't reintroduce it.
Test case copied from CL 550237 (by bcmills).
Fixes #64738.
Change-Id: I9654a1fd46fe1a1cc63ee6645a552ec21d720ad0
Reviewed-on: https://go-review.googlesource.com/c/go/+/551255
Reviewed-by: Michael Matloob <matloob@golang.org>
Auto-Submit: Russ Cox <rsc@golang.org>
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Daniel Martà <mvdan@mvdan.cc>
Reviewed-by: Bryan Mills <bcmills@google.com>
--- /dev/null
+# Regression test for https://go.dev/issue/64738:
+# a bug in 'go run' caused flags arguments after the requested package to
+# also be parsed as cmd/go flags.
+go run -n example.com/printversion@v0.1.0 -p ignored