mirror of
https://github.com/golang/go
synced 2024-11-06 14:36:22 -07:00
caf968616a
To allow testing of fixedbugs/bug345.go in Go, a new flag -n is introduced. This flag disables setting of relative path for local imports and imports search path to current dir, namely -D . -I . are not passed to the compiler. Error regexps are fixed to allow running the test in temp directory. This change eliminates the last place where Perl script "errchk" was used. Fixes #25586. Change-Id: If085f466e6955312d77315f96d3ef1cb68495aef Reviewed-on: https://go-review.googlesource.com/115277 Run-TryBot: Yury Smolsky <yury@smolsky.by> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
30 lines
956 B
Go
30 lines
956 B
Go
// Copyright 2011 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package main
|
|
|
|
import (
|
|
"bufio"
|
|
goio "io"
|
|
|
|
"./io"
|
|
)
|
|
|
|
func main() {
|
|
// The errors here complain that io.X != io.X
|
|
// for different values of io so they should be
|
|
// showing the full import path, which for the
|
|
// "./io" import is really ..../go/test/io.
|
|
// For example:
|
|
//
|
|
// main.go:25: cannot use w (type "/Users/rsc/g/go/test/fixedbugs/bug345.dir/io".Writer) as type "io".Writer in function argument:
|
|
// io.Writer does not implement io.Writer (missing Write method)
|
|
// main.go:27: cannot use &x (type *"io".SectionReader) as type *"/Users/rsc/g/go/test/fixedbugs/bug345.dir/io".SectionReader in function argument
|
|
|
|
var w io.Writer
|
|
bufio.NewWriter(w) // ERROR "[\w.]+[^.]/io|has incompatible type"
|
|
var x goio.SectionReader
|
|
io.SR(&x) // ERROR "[\w.]+[^.]/io|has incompatible type"
|
|
}
|