SplitOutputs splits and sorts the comma-separated list of outputs. It skips any empty outputs. If one or more of the outputs is a "*", then the result will be a slice with a single "*" element.
()
| 676 | // any empty outputs. If one or more of the outputs is a "*", then the result |
| 677 | // will be a slice with a single "*" element. |
| 678 | func (fi Installable) SplitOutputs() []string { |
| 679 | if fi.Outputs == "" { |
| 680 | return []string{} |
| 681 | } |
| 682 | |
| 683 | split := strings.Split(fi.Outputs, ",") |
| 684 | i := 0 |
| 685 | for _, out := range split { |
| 686 | // A wildcard takes priority over any other outputs. |
| 687 | if out == "*" { |
| 688 | return []string{"*"} |
| 689 | } |
| 690 | if out != "" { |
| 691 | split[i] = out |
| 692 | i++ |
| 693 | } |
| 694 | } |
| 695 | split = split[:i] |
| 696 | slices.Sort(split) |
| 697 | return split |
| 698 | } |
| 699 | |
| 700 | // String encodes the installable as a Nix command line argument. It normalizes |
| 701 | // the result such that if two installable values are equal, then their strings |
no outgoing calls
no test coverage detected