sourceGenerators returns a comma-separated SourceString from the given generator slice.
(gens []StatementGenerator)
| 740 | |
| 741 | // sourceGenerators returns a comma-separated SourceString from the given generator slice. |
| 742 | func sourceGenerators(gens []StatementGenerator) string { |
| 743 | gens = removeNilGenerators(gens) |
| 744 | if len(gens) == 0 { |
| 745 | return "" |
| 746 | } |
| 747 | sourceStrs := make([]string, len(gens)) |
| 748 | for i, gen := range gens { |
| 749 | sourceStrs[i] = gen.SourceString() |
| 750 | } |
| 751 | return strings.Join(sourceStrs, ", ") |
| 752 | } |
| 753 | |
| 754 | // removeNilGenerators returns a new slice of generators with all nils removed. |
| 755 | func removeNilGenerators(gens []StatementGenerator) []StatementGenerator { |
no test coverage detected