MCPcopy
hub / github.com/google/mangle / getStringValue

Function getStringValue

builtin/builtin.go:616–622  ·  view source on GitHub ↗
(baseTerm ast.BaseTerm)

Source from the content-addressed store, hash-verified

614}
615
616func getStringValue(baseTerm ast.BaseTerm) (string, error) {
617 constant, ok := baseTerm.(ast.Constant)
618 if !ok || constant.Type != ast.StringType {
619 return "", fmt.Errorf("value %v (%T) is not a string", baseTerm, baseTerm)
620 }
621 return constant.StringValue()
622}
623
624func getNumberValue(b ast.BaseTerm) (int64, error) {
625 c, ok := b.(ast.Constant)

Callers

nothing calls this directly

Calls 1

StringValueMethod · 0.80

Tested by

no test coverage detected