MCPcopy
hub / github.com/google/mtail / PopString

Method PopString

internal/runtime/vm/vm.go:171–186  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

169}
170
171func (t *thread) PopString() (string, error) {
172 val := t.Pop()
173 switch n := val.(type) {
174 case string:
175 return n, nil
176 case float64:
177 return strconv.FormatFloat(n, 'G', -1, 64), nil
178 case int:
179 return strconv.Itoa(n), nil
180 case int64:
181 return strconv.FormatInt(n, 10), nil
182 case datum.Datum:
183 return datum.GetString(n), nil
184 }
185 return "", errors.Errorf("unexpected type for string %T %q", val, val)
186}
187
188func compareInt(a, b int64, opnd int) (bool, error) {
189 switch opnd {

Callers 2

TestDatumFetchInstrsFunction · 0.80
executeMethod · 0.80

Calls 2

PopMethod · 0.95
GetStringFunction · 0.92

Tested by 1

TestDatumFetchInstrsFunction · 0.64