package unsafe \"unsafe\" has no symbol Slice"
section1Q84 opened this issue · comments
section1q84 commented
The following program sample.go
triggers an unexpected result
package main
import (
"github.com/traefik/yaegi/stdlib"
"github.com/traefik/yaegi/stdlib/unsafe"
)
var payload = `
package main
func main() {
StringToBytes("a")
}
func StringToBytes(s string) []byte {
return unsafe.Slice(unsafe.StringData(s), len(s))
}
`
func main() {
i := interp.New(interp.Options{})
i.Use(stdlib.Symbols)
i.Use(unsafe.Symbols)
}
Expected result
normal
Got
package unsafe \"unsafe\" has no symbol Slice"
Yaegi Version
latest
Additional Notes
No response