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
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
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 _ =
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
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: