Files
ziran/std/random_go.zi
T
waozi 3e0be78226 Add Go standard modules for random, sync, text, and time
std/random_go.zi, std/sync_go.zi, std/text_go.zi, and std/time_go.zi
bind the matching Go packages for the Go target, with method calls and
multiple results covered by tests/go_methods.sh and tests/go_results.sh.
2026-09-29 21:28:55 -03:00

17 lines
376 B
Ziran

// Cryptographic random bytes from Go, preserving its count and error results.
#import "go_types"
go_rand :: #system_library "go:crypto/rand";
ReadResult :: struct {
count: isize
error: Error
}
#scope_file
ReadRaw :: (output: []u8) -> ReadResult #go_results #foreign go_rand "Read";
#scope_export
Fill :: (output: []u8) -> ReadResult {
return ReadRaw(output)
}