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

Method Rename

expr/types.go:501–508  ·  view source on GitHub ↗

Rename changes the name of the named attribute n to m. Rename does nothing if o does not have an attribute named n.

(n, m string)

Source from the content-addressed store, hash-verified

499// Rename changes the name of the named attribute n to m. Rename does nothing if
500// o does not have an attribute named n.
501func (o *Object) Rename(n, m string) {
502 for _, nat := range *o {
503 if nat.Name == n {
504 nat.Name = m
505 return
506 }
507 }
508}
509
510// Kind implements DataKind.
511func (*Object) Kind() Kind { return ObjectKind }

Callers 1

TestObjectRenameFunction · 0.95

Calls

no outgoing calls

Tested by 1

TestObjectRenameFunction · 0.76