1
0
mirror of https://github.com/golang/go synced 2024-11-17 01:34:52 -07:00
go/test/fixedbugs/issue5957.dir/c.go
Matthew Dempsky b95d332c7e test: compile source files as if from "test" module
This CL updates test/run.go to compile xxx.dir/x.go with a package
path of "test/x" instead of just "x". This prevents collisions with
standard library packages.

It also requires updating a handful of tests to account for the
updated package paths.

Fixes #25693.

Change-Id: I49208c56ab3cb229ed667d547cd6e004d2175fcf
Reviewed-on: https://go-review.googlesource.com/c/go/+/395258
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-03-24 17:50:47 +00:00

13 lines
546 B
Go

package p
import (
"./a" // ERROR "imported and not used: \x22test/a\x22 as surprise|imported and not used: surprise"
"./b" // ERROR "imported and not used: \x22test/b\x22 as surprise2|imported and not used: surprise2"
b "./b" // ERROR "imported and not used: \x22test/b\x22$|imported and not used: surprise2"
foo "math" // ERROR "imported and not used: \x22math\x22 as foo|imported and not used: math"
"fmt" // actually used
"strings" // ERROR "imported and not used: \x22strings\x22|imported and not used: strings"
)
var _ = fmt.Printf