Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package unsafe \"unsafe\" has no symbol Slice" #1604

Open
section1Q84 opened this issue Jan 5, 2024 · 0 comments
Open

package unsafe \"unsafe\" has no symbol Slice" #1604

section1Q84 opened this issue Jan 5, 2024 · 0 comments

Comments

@section1Q84
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant