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

Function DoubleError

tests/runtime/results/leaf.go:57–71  ·  view source on GitHub ↗
(x uint32)

Source from the content-addressed store, hash-verified

55}
56
57func DoubleError(x uint32) Result[Result[Unit, string], string] {
58 if x == 0 {
59 return Ok[Result[Unit, string], string](
60 Ok[Unit, string](Unit{}),
61 )
62 } else if x == 1 {
63 return Ok[Result[Unit, string], string](
64 Err[Unit, string]("one"),
65 )
66 } else {
67 return Err[Result[Unit, string], string](
68 "two",
69 )
70 }
71}

Callers 2

DoubleErrorMethod · 0.70
RunMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected