Skip to content

Commit

Permalink
Create a repository to reproduce golang/go#25065.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunabe committed May 30, 2018
0 parents commit f440f64
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
@@ -0,0 +1,13 @@
# gobug25065
A repository to reproduce https://github.com/golang/go/issues/25065

# Usage
Make sure `$GOPATH` is set properly. Then, run the following commands.

```shell
go get -d github.com/yunabe/gobug25065
$(go env GOPATH)/src/github.com/yunabe/gobug25065/run.sh
```

# Note
The error is gone if we remove `fmt.Println((*myType).A)` from `src.go`.
16 changes: 16 additions & 0 deletions run.sh
@@ -0,0 +1,16 @@
pkgdir=$(go env GOPATH)/src/github.com/yunabe/gobug25065/pkg
rm -rf $pkgdir

echo '## Building libstd.so ##'
go install -buildmode=shared -pkgdir $pkgdir std
echo '## Building gobug25065 ##'
go install -v -x -buildmode=shared -linkshared -pkgdir $pkgdir github.com/yunabe/gobug25065

if [ $? -eq 0 ]; then
echo '## Show stats ##'
ls -lah $pkgdir/*.so
ldd $pkgdir/*.so
else
echo FAIL
fi
rm -rf $pkgdir
18 changes: 18 additions & 0 deletions src.go
@@ -0,0 +1,18 @@
package gobug25065

import (
"fmt"
)

type myType struct {}

func (m myType) A() {}
func (p *myType) B() {}

func Fn() {
p := &myType{}
(*myType).A(p) // OK
fmt.Println((*myType).A) // NG
(*myType).B(p) // OK
fmt.Println((*myType).B) // OK
}

0 comments on commit f440f64

Please sign in to comment.