mirror of
https://github.com/golang/go
synced 2024-11-23 08:40:08 -07:00
f8ac237032
The pattern in NNN.dir directories is that if we have a.go, the other files import "./a". For gc it happens to work to use a path, but not for gofrontend. Better to be consistent. Change-Id: I2e023cbf6bd115f9fb77427b097b0ff9b9992f17 Reviewed-on: https://go-review.googlesource.com/c/go/+/278113 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Cherry Zhang <cherryyz@google.com>
27 lines
569 B
Go
27 lines
569 B
Go
// Copyright 2017 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 (
|
|
"reflect"
|
|
fake "./a" // 2nd package with name "reflect"
|
|
)
|
|
|
|
type T struct {
|
|
_ fake.Type
|
|
}
|
|
|
|
func (T) f() {}
|
|
func (T) G() (_ int) { return }
|
|
func (T) H() (_, _ int) { return }
|
|
|
|
func main() {
|
|
var x T
|
|
typ := reflect.TypeOf(x)
|
|
for i := 0; i < typ.NumMethod(); i++ {
|
|
_ = typ.Method(i) // must not crash
|
|
}
|
|
}
|