Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

strings.Indent should not indent when width is 0 #268

Merged
merged 2 commits into from
Mar 3, 2018
Merged

strings.Indent should not indent when width is 0 #268

merged 2 commits into from
Mar 3, 2018

Conversation

keitwb
Copy link
Contributor

@keitwb keitwb commented Mar 3, 2018

When recursively generating YAML, it is useful to have a simple generic template definition that starts with an indent of 0 and increments at each level YAML. If you pass width of 0 to the function as it was before this change, it would indent it one level without complaining, which was a great source of confusion to me.

When recursively generating YAML, it is useful to have a simple generic template definition that starts with an indent of 0 and increments at each level YAML.  If you pass `width` of 0 to the function as it was before this change, it would indent it one level without complaining, which was a great source of confusion to me.
@hairyhenderson hairyhenderson changed the title Allow no indentation in strings.Indent strings.Indent should not indent when width is 0 Mar 3, 2018
@hairyhenderson
Copy link
Owner

Hi @keitwb! Thanks for taking the time to fix this. Not only is this confusing - it's a bug 😉

Signed-off-by: Dave Henderson <dhenderson@gmail.com>
@hairyhenderson hairyhenderson merged commit b3c245c into hairyhenderson:master Mar 3, 2018
@keitwb keitwb deleted the patch-1 branch March 3, 2018 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants