We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In golang you're able to do (https://go.dev/play/p/1gERcS_9z_l)
package main import "fmt" func main() { var byteArray []byte = []byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20} arrayTwenty := [20]byte(byteArray) fmt.Println(arrayTwenty) }
trying to do something equivalent on Gnolang, you can go to gnovm/stdlibs/std/crypto.go and modify convertTo20Byte function as follows:
gnovm/stdlibs/std/crypto.go
func convertTo20Byte(in []byte) [20]byte { return [20]byte(in) }
running gno test . on sdt package will result on
gno test .
.: test pkg: panic: cannot convert []uint8 to ArrayKind go stacktrace:
Tell us what should happen
Tell us what happens instead
Please paste any logs here that demonstrate the issue, if they exist
If you have an idea of how to fix this issue, please write it down here, so we can begin discussing it
The text was updated successfully, but these errors were encountered:
This is a recent feature in Go as well, so implementation of this feature is a non-priority but I think we can accept a PR.
Sorry, something went wrong.
No branches or pull requests
Slice-to-Array Casting Limitation
Description
In golang you're able to do (https://go.dev/play/p/1gERcS_9z_l)
trying to do something equivalent on Gnolang,
you can go to
gnovm/stdlibs/std/crypto.go
and modify convertTo20Byte function as follows:running
gno test .
on sdt package will result on.: test pkg: panic: cannot convert []uint8 to ArrayKind go stacktrace:
Your environment
Steps to reproduce
Expected behaviour
Tell us what should happen
Actual behaviour
Tell us what happens instead
Logs
Please paste any logs here that demonstrate the issue, if they exist
Proposed solution
If you have an idea of how to fix this issue, please write it down here, so we can begin discussing it
The text was updated successfully, but these errors were encountered: