MCPcopy Create free account
hub / github.com/goadesign/goa / Last

Method Last

expr/root.go:395–407  ·  view source on GitHub ↗

Last returns the last value for a specific key, if the key exists and has values; otherwise returns an empty string, with the "ok" flag set to false.

(key string)

Source from the content-addressed store, hash-verified

393// Last returns the last value for a specific key, if the key exists and has
394// values; otherwise returns an empty string, with the "ok" flag set to false.
395func (m MetaExpr) Last(key string) (string, bool) {
396 v, ok := m[key]
397 if !ok {
398 return "", false
399 }
400
401 l := len(v)
402 if l < 1 {
403 return "", false
404 }
405
406 return v[l-1], true
407}

Callers 15

FinalizeMethod · 0.80
FinalizeMethod · 0.80
ValidateMethod · 0.80
ValidateMethod · 0.80
FieldTagMethod · 0.80
useExplicitViewMethod · 0.80
projectRecursiveFunction · 0.80
TestMetaExpr_LastFunction · 0.80
ExampleMethod · 0.80
buildResultDataMethod · 0.80
buildResponsesMethod · 0.80

Calls

no outgoing calls

Tested by 1

TestMetaExpr_LastFunction · 0.64