mirror of
https://github.com/golang/go
synced 2024-11-20 11:24:47 -07:00
1f27519988
Added a return to bug357.go to avoid an error which gccgo reports but 6g does not. bug353.go:16:14: error: reference to undefined identifer ‘io.ReadWriterCloser’ bug357.go:18:2: error: value computed is not used bug358.go:14:11: error: imported and not used: ioutil bug358.go:19:9: error: invalid use of type bug359.go:25:14: error: redefinition of ‘a’ bug359.go:25:6: note: previous definition of ‘a’ was here bug359.go:19:6: error: incompatible type in initialization (implicit assignment of ‘list.List’ hidden field ‘front’) bug362.go:13:6: error: iota is only defined in const declarations bug362.go:14:6: error: iota is only defined in const declarations bug362.go:15:6: error: iota is only defined in const declarations bug363.go:13:12: error: shift of non-integer operand bug363.go:16:12: error: shift of non-integer operand bug365.go:15:8: error: expected package R=golang-dev, gri CC=golang-dev https://golang.org/cl/5078046
31 lines
504 B
Go
31 lines
504 B
Go
// errchk $G $D/$F.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.
|
|
|
|
// issue 2089 - internal compiler error
|
|
|
|
package main
|
|
|
|
import (
|
|
"io"
|
|
"os"
|
|
)
|
|
|
|
func echo(fd io.ReadWriterCloser) { // ERROR "undefined.*io.ReadWriterCloser"
|
|
var buf [1024]byte
|
|
for {
|
|
n, err := fd.Read(buf)
|
|
if err != nil {
|
|
break
|
|
}
|
|
fd.Write(buf[0:n])
|
|
}
|
|
}
|
|
|
|
func main() {
|
|
fd, _ := os.Open("a.txt")
|
|
echo(fd)
|
|
}
|