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.
17 lines
376 B
Ziran
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)
|
|
}
|