docs: clarify that seq returns a string, not an integer slice#479
Open
c-tonneslan wants to merge 1 commit into
Open
docs: clarify that seq returns a string, not an integer slice#479c-tonneslan wants to merge 1 commit into
c-tonneslan wants to merge 1 commit into
Conversation
The seq function is documented on integer_slice.md alongside until and untilStep, but unlike those two it returns a space-separated string, not a slice. The wording made it sound like another slice-returning helper, so anyone trying to range over the result hits a type error and ends up filing it as a bug (issue Masterminds#465). Note up front what seq actually returns and point readers at until / untilStep if they want a slice they can iterate. Closes Masterminds#465 Signed-off-by: Charlie Tonneslan <cst0520@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #465.
seqlives on the "Integer Slice Functions" docs page next tountilanduntilStep, but it returns a space-separated string instead of a[]int. The page never says that, so the natural reading is "all three of these return slices" and people try to range over the result. That's what filed the bug.Just adds a short paragraph after the
## seqheading noting the return type and pointing atuntil/untilStepfor an actual slice. No code change, the bash-like behavior is intentional.