(pkg *Package)
| 12 | } |
| 13 | |
| 14 | func (out *outputs) GetNames(pkg *Package) ([]string, error) { |
| 15 | if len(out.selectedNames) > 0 { |
| 16 | return out.selectedNames, nil |
| 17 | } |
| 18 | |
| 19 | // else, get the default outputs from the lockfile |
| 20 | // if we haven't already |
| 21 | if out.defaultNames == nil { |
| 22 | if err := out.initDefaultNames(pkg); err != nil { |
| 23 | return []string{}, err |
| 24 | } |
| 25 | } |
| 26 | return out.defaultNames, nil |
| 27 | } |
| 28 | |
| 29 | // initDefaultNames initializes the defaultNames field of the Outputs object. |
| 30 | // We run this lazily (rather than eagerly in initOutputs) because it depends on the Package, |
no test coverage detected