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

Function StringError

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

Source from the content-addressed store, hash-verified

7)
8
9func StringError(x float32) Result[float32, string] {
10 if x == 0.0 {
11 return Err[float32, string]("zero")
12 } else {
13 return Ok[float32, string](x)
14 }
15}
16
17func EnumError(x float32) Result[float32, E] {
18 if x == 0.0 {

Callers 2

StringErrorMethod · 0.70
RunMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected