JoinDoc joins Docs d with Doc s.
(s Doc, d ...Doc)
| 18 | |
| 19 | // JoinDoc joins Docs d with Doc s. |
| 20 | func JoinDoc(s Doc, d ...Doc) Doc { |
| 21 | switch len(d) { |
| 22 | case 0: |
| 23 | return Nil |
| 24 | case 1: |
| 25 | return d[0] |
| 26 | default: |
| 27 | return Fold(Concat, d[0], s, JoinDoc(s, d[1:]...)) |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | // JoinNestedRight nests nested with string s. |
| 32 | // Every item after the first is indented. |