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

Method GoTypeDefWithTargetPkg

codegen/scope.go:139–141  ·  view source on GitHub ↗

GoTypeDefWithTargetPkg returns the Go type definition string, qualifying any user types inside inline structs with the provided target package. This helps when generating JSON-RPC client types that embed inline structs referencing user types defined in a separate package (e.g., gen/types).

(att *expr.AttributeExpr, ptr, useDefault bool, targetPkg string)

Source from the content-addressed store, hash-verified

137// when generating JSON-RPC client types that embed inline structs referencing
138// user types defined in a separate package (e.g., gen/types).
139func (s *NameScope) GoTypeDefWithTargetPkg(att *expr.AttributeExpr, ptr, useDefault bool, targetPkg string) string {
140 return s.goTypeDefWithPkgOverride(att, ptr, useDefault, "", targetPkg)
141}
142
143// goTypeDefWithPkgOverride generates the Go type definition string for the attribute.
144// When targetPkg is not empty, user types referenced inside inline structs are

Callers 1

NameMethod · 0.80

Calls 1

Tested by

no test coverage detected