Re: [go-nuts] Is there any import path limitation when using go:linkname localname importpath.name?

2017-01-20 Thread Ian Lance Taylor
On Fri, Jan 20, 2017 at 12:16 AM, Cholerae Hu wrote: > I removed the alias "pri", and it works, thanks! > By the way, when go:linkname with runtime, why don't I need to import > "runtime" package explicitly? The runtime package is always imported implicitly by every Go

Re: [go-nuts] Is there any import path limitation when using go:linkname localname importpath.name?

2017-01-20 Thread Cholerae Hu
I removed the alias "pri", and it works, thanks! By the way, when go:linkname with runtime, why don't I need to import "runtime" package explicitly? 在 2017年1月20日星期五 UTC+8下午1:34:43,Ian Lance Taylor写道: > > On Wed, Jan 18, 2017 at 6:55 PM, Cholerae Hu > wrote: > > I'm trying

Re: [go-nuts] Is there any import path limitation when using go:linkname localname importpath.name?

2017-01-19 Thread Cholerae Hu
I edited my code to import test/pri in test/pub: pri/a.go: package pri import ( "fmt" ) const ( Dummy = 1 ) func rua() int64 { fmt.Println("rua in pri") return int64(1) } pub/b.go: package pub import ( "unsafe" pri "test/pri" ) var _ = unsafe.Sizeof(0) var _ =

Re: [go-nuts] Is there any import path limitation when using go:linkname localname importpath.name?

2017-01-19 Thread Ian Lance Taylor
On Wed, Jan 18, 2017 at 6:55 PM, Cholerae Hu wrote: > I'm trying to play with go:linkname, and I wrote a demo for this. > > directory structure: > > [test]$ tree > . > ├── main.go > ├── pri > │ └── a.go > └── pub > ├── issue15006.s > └── b.go > > a.go: > > package

[go-nuts] Is there any import path limitation when using go:linkname localname importpath.name?

2017-01-18 Thread Cholerae Hu
I'm trying to play with go:linkname, and I wrote a demo for this. directory structure: [test]$ tree . ├── main.go ├── pri │ └── a.go └── pub ├── issue15006.s └── b.go a.go: package pri import ( "fmt" ) func rua() int64 { fmt.Println("rua in pri") return 1 } b.go: