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