MCPcopy Index your code
hub / github.com/livebud/bud / loadType

Method loadType

framework/controller/loader.go:326–345  ·  view source on GitHub ↗
(dt parser.Type, dec parser.Declaration)

Source from the content-addressed store, hash-verified

324}
325
326func (l *loader) loadType(dt parser.Type, dec parser.Declaration) string {
327 // TODO: Error out for certain built-ins (e.g. chan)
328 if dec.Kind() == parser.KindBuiltin {
329 return dt.String()
330 }
331 // Find the import path
332 importPath, err := dec.Package().Import()
333 if err != nil {
334 l.Bail(err)
335 }
336 // Standard library
337 if gois.StdLib(importPath) {
338 dt := parser.Requalify(dt, imports.AssumedName(importPath))
339 return dt.String()
340 }
341 // Add the type's import
342 name := l.imports.Add(importPath)
343 dt = parser.Qualify(dt, name)
344 return dt.String()
345}
346
347func (l *loader) loadActionInput(params []*ActionParam) string {
348 if len(params) == 1 && params[0].Kind == string(parser.KindStruct) {

Callers 1

loadActionParamMethod · 0.95

Calls 10

StdLibFunction · 0.92
RequalifyFunction · 0.92
AssumedNameFunction · 0.92
QualifyFunction · 0.92
BailMethod · 0.80
KindMethod · 0.65
StringMethod · 0.65
PackageMethod · 0.65
AddMethod · 0.65
ImportMethod · 0.45

Tested by

no test coverage detected