-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve handling of chained methods (#28)
* Update comment * Update comments and recursive checking * Change default behavior of change-methods * Update fixtures * Fix flag name and update README * Update README * Update README * Update README * Fix README
- Loading branch information
1 parent
285bfb8
commit fb67b70
Showing
9 changed files
with
157 additions
and
49 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,25 @@ | ||
package fixtures | ||
|
||
import "fmt" | ||
|
||
type Chain struct{} | ||
|
||
func (c *Chain) ChainCall(a string, b string, c string) *Chain { | ||
func (c *Chain) ChainCall(arg1 string, arg2 string, arg3 string) *Chain { | ||
return c | ||
} | ||
|
||
func NewChain() *Chain { | ||
return &Chain{} | ||
} | ||
|
||
func ChainedCalls() { | ||
c := Chain{} | ||
c.ChainCall("a long argument", "another long argument", "a third long argument").ChainCall("a long argument2", "another long argument2", "a third long argument2").ChainCall("a long argument3", "another long argument3", "a third long argument3") | ||
NewChain().ChainCall( | ||
"a really really really really really long argument4", | ||
"another really really really really really long argument4", | ||
fmt.Sprintf("%v", "this is a long method")).ChainCall("a really really really really really long argument5", "another really really really really really long argument5", "a third really really really really really long argument5").ChainCall("a", "b", fmt.Sprintf("%v", "this is a long method")) | ||
NewChain().ChainCall("a", "b", "c").ChainCall("d", "e", "f") | ||
NewChain().ChainCall("a", "b", "c"). | ||
ChainCall("d", "e", "f").ChainCall("g", "h", "i") | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,30 @@ | ||
package fixtures | ||
|
||
import "fmt" | ||
|
||
type Chain struct{} | ||
|
||
func (c *Chain) ChainCall(a string, b string, c string) *Chain { | ||
func (c *Chain) ChainCall(arg1 string, arg2 string, arg3 string) *Chain { | ||
return c | ||
} | ||
|
||
func NewChain() *Chain { | ||
return &Chain{} | ||
} | ||
|
||
func ChainedCalls() { | ||
c := Chain{} | ||
c.ChainCall( | ||
"a long argument", | ||
"another long argument", | ||
"a third long argument", | ||
).ChainCall( | ||
"a long argument2", | ||
"another long argument2", | ||
"a third long argument2", | ||
).ChainCall( | ||
"a long argument3", | ||
"another long argument3", | ||
"a third long argument3", | ||
) | ||
c.ChainCall("a long argument", "another long argument", "a third long argument"). | ||
ChainCall("a long argument2", "another long argument2", "a third long argument2"). | ||
ChainCall("a long argument3", "another long argument3", "a third long argument3") | ||
NewChain().ChainCall( | ||
"a really really really really really long argument4", | ||
"another really really really really really long argument4", | ||
fmt.Sprintf("%v", "this is a long method"), | ||
). | ||
ChainCall("a really really really really really long argument5", "another really really really really really long argument5", "a third really really really really really long argument5"). | ||
ChainCall("a", "b", fmt.Sprintf("%v", "this is a long method")) | ||
NewChain().ChainCall("a", "b", "c").ChainCall("d", "e", "f") | ||
NewChain().ChainCall("a", "b", "c"). | ||
ChainCall("d", "e", "f").ChainCall("g", "h", "i") | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.