MCPcopy Create free account
hub / github.com/araddon/qlbridge / FromExpr

Method FromExpr

expr/node.go:1067–1082  ·  view source on GitHub ↗
(e *Expr)

Source from the content-addressed store, hash-verified

1065 return &Expr{Identity: m.Text}
1066}
1067func (m *IdentityNode) FromExpr(e *Expr) error {
1068 if len(e.Identity) > 0 {
1069 m.Text = e.Identity
1070 m.load()
1071 return nil
1072 } else if e.Value != "" {
1073 m.Text = e.Value
1074 val := strings.ToLower(m.Text)
1075 if val != "true" && val != "false" {
1076 return fmt.Errorf("Value identities are either 'true' or 'false' but got %q", m.Text)
1077 }
1078 m.load()
1079 return nil
1080 }
1081 return fmt.Errorf("unrecognized identity")
1082}
1083func (m *IdentityNode) IsBooleanIdentity() bool {
1084 val := strings.ToLower(m.Text)
1085 if val == "true" || val == "false" {

Callers

nothing calls this directly

Calls 2

loadMethod · 0.95
ErrorfMethod · 0.80

Tested by

no test coverage detected