Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a repository to reproduce golang/go#25065.
- Loading branch information
0 parents
commit f440f64
Showing
3 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |