JoinDoc joins Docs d with Doc s.
(s Doc, d ...Doc)
| 37 | |
| 38 | // JoinDoc joins Docs d with Doc s. |
| 39 | func JoinDoc(s Doc, d ...Doc) Doc { |
| 40 | switch len(d) { |
| 41 | case 0: |
| 42 | return Nil |
| 43 | case 1: |
| 44 | return d[0] |
| 45 | default: |
| 46 | return Fold(Concat, d[0], s, JoinDoc(s, d[1:]...)) |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | // JoinNestedRight nests nested with string s. |
| 51 | // Every item after the first is indented. |