preferredIndentationStr returns a single string given the indentation preference
(size int, useSpace bool)
| 93 | |
| 94 | // preferredIndentationStr returns a single string given the indentation preference |
| 95 | func preferredIndentationStr(size int, useSpace bool) (string, error) { |
| 96 | if size < 0 { |
| 97 | return "", fmt.Errorf("invalid indentation size: %d", size) |
| 98 | } |
| 99 | |
| 100 | indentationStr := "\t" |
| 101 | if useSpace { |
| 102 | indentationStr = " " |
| 103 | } |
| 104 | return strings.Repeat(indentationStr, size), nil |
| 105 | } |
no outgoing calls