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

Add Compound Parameters #340

Merged
merged 19 commits into from
Oct 6, 2016
Merged

Conversation

BrianHicks
Copy link
Contributor

See examples for more.

Fixes #110

@BrianHicks
Copy link
Contributor Author

@stevendborrelli that TODO codeclimate is complaining about is the one that it'd be really helpful if you'd fill in

{{< note title="Backwards arguments?" >}}
Some of the utility functions (like `split` and `join`) seem to have their
arguments backwards. This is to allow you to pipe values to them. For example,
joining a list on strings is `{{paramList "x" | join "\n"}}`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"list of strings"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops! I've fixed this in the latest push.

@BrianHicks BrianHicks force-pushed the feature/lists-in-params-part-ii branch from 29ba605 to 10ddbd5 Compare October 5, 2016 15:24
@rebeccaskinner rebeccaskinner self-assigned this Oct 5, 2016
Copy link
Contributor

@rebeccaskinner rebeccaskinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM other than a couple of small nits.

arguments backwards. This is to allow you to pipe values to them. For example,
joining a list of strings is `{{paramList "x" | join "\n"}}`
{{< /note >}}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a sentence or two here about what happens if I try to pipe a list of type int to a function like join that operates on a list of strings?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The answer before: join fails because it's the wrong type. But that's just silly, since we don't have any way to do type conversions. So now it'll just stringify any arguments passed to it. See 7e65cc6

@@ -187,18 +203,18 @@ func newStub(returnVal interface{}) func(...string) (interface{}, error) {
// RememberCalls takes a pointer to a list of strings, and an argument
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should update the comment to reflect that we no longer take an index, but do take a return type.

@BrianHicks BrianHicks force-pushed the feature/lists-in-params-part-ii branch from edd5a05 to 79b2ad9 Compare October 6, 2016 18:27
@stevendborrelli stevendborrelli merged commit 24cb565 into master Oct 6, 2016
@stevendborrelli stevendborrelli deleted the feature/lists-in-params-part-ii branch October 6, 2016 18:56
@stevendborrelli stevendborrelli added this to the 0.3.0 milestone Oct 17, 2016
stevendborrelli added a commit that referenced this pull request Oct 19, 2016
stevendborrelli added a commit that referenced this pull request Oct 19, 2016
BrianHicks pushed a commit that referenced this pull request Oct 21, 2016
BrianHicks pushed a commit that referenced this pull request Dec 22, 2016
BrianHicks pushed a commit that referenced this pull request Dec 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants