go-python / go-python/gopy

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

Abierto
#381 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Go
Estrellas
2.3k
Forks
136
Merge medio
14 min
PR fusionados (30 d)
2

Descripción

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.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.