MCPcopy Index your code
hub / github.com/jetify-com/devbox / initDefaultNames

Method initDefaultNames

internal/devpkg/outputs.go:32–47  ·  view source on GitHub ↗

initDefaultNames initializes the defaultNames field of the Outputs object. We run this lazily (rather than eagerly in initOutputs) because it depends on the Package, and initOutputs is called from the Package constructor, so cannot depend on Package.

(pkg *Package)

Source from the content-addressed store, hash-verified

30// We run this lazily (rather than eagerly in initOutputs) because it depends on the Package,
31// and initOutputs is called from the Package constructor, so cannot depend on Package.
32func (out *outputs) initDefaultNames(pkg *Package) error {
33 sysInfo, err := pkg.sysInfoIfExists()
34 if err != nil {
35 return err
36 }
37
38 out.defaultNames = []string{}
39 if sysInfo == nil {
40 return nil
41 }
42
43 for _, output := range sysInfo.DefaultOutputs() {
44 out.defaultNames = append(out.defaultNames, output.Name)
45 }
46 return nil
47}

Callers 1

GetNamesMethod · 0.95

Calls 2

sysInfoIfExistsMethod · 0.80
DefaultOutputsMethod · 0.80

Tested by

no test coverage detected