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

Method GoVar

codegen/scope.go:245–251  ·  view source on GitHub ↗

GoVar returns the Go code that returns the address of a variable of the Go type which matches the given attribute type.

(varName string, dt expr.DataType)

Source from the content-addressed store, hash-verified

243// GoVar returns the Go code that returns the address of a variable of the Go type
244// which matches the given attribute type.
245func (*NameScope) GoVar(varName string, dt expr.DataType) string {
246 // For a raw struct, no need to indirecting
247 if isRawStruct(dt) {
248 return varName
249 }
250 return "&" + varName
251}
252
253// GoTypeRef returns the Go code that refers to the Go type which matches the
254// given attribute type.

Callers 1

buildPayloadDataMethod · 0.80

Calls 1

isRawStructFunction · 0.85

Tested by

no test coverage detected