go-python / go-python/gopy

Compile error when a function parameter name is same with package name

オープン
#381 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Go
スター
2.3k
フォーク
136
平均マージ
14分
マージ済み PR(30日)
2

説明

See example:
```go
package packet

func GoPacketToBytes(shieldID int, packet Packet) ([]byte, error) { // gopy bug
buf := bytes.NewBuffer([]byte{})
w := protocol.NewWriter(buf, int32(shieldID))
packet.Marshal(w)
return buf.Bytes(), nil
}
```
Use `gopy build` it will generate Go file which includes:
```go
packet.GoPacketToBytes( ... )
```
which causes compile problem.
Rename parameter `packet` could solve it, but it's better to fix this problem since the error log is weird to greenhands.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。