MCPcopy Create free account
hub / github.com/bytecodealliance/wit-bindgen / RecordError

Function RecordError

tests/runtime/results/leaf.go:25–33  ·  view source on GitHub ↗
(x float32)

Source from the content-addressed store, hash-verified

23}
24
25func RecordError(x float32) Result[float32, E2] {
26 if x == 0.0 {
27 return Err[float32, E2](E2{420, 0})
28 } else if x == 1.0 {
29 return Err[float32, E2](E2{77, 2})
30 } else {
31 return Ok[float32, E2](x)
32 }
33}
34
35func VariantError(x float32) Result[float32, E3] {
36 if x == 0.0 {

Callers 2

RecordErrorMethod · 0.70
RunMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected