-
Notifications
You must be signed in to change notification settings - Fork 40
Add ability to pass arbitrary arguments to go test
#26
base: main
Are you sure you want to change the base?
Conversation
…s directly to `go test`. After the ability to pass arbitrary flags to `go test` [nathany#26](nathany#26), there was no reason to keep the `-tags` flag. Removing `-tags` leaves only `-debug` and that makes sense to move to an environment variable (`$LOOPER_DEBUG`). Removing looper flags allows us to drop the need for `--` to pass options to `go test`, so now we can call looper just like go test.
…s directly to `go test`. After the ability to pass arbitrary flags to `go test` [nathany#26](nathany#26), there was no reason to keep the `-tags` flag. Removing `-tags` leaves only `-debug` and that makes sense to move to an environment variable (`$LOOPER_DEBUG`). Removing looper flags allows us to drop the need for `--` to pass options to `go test`, so now we can call looper just like go test.
args := []string{"test"} | ||
|
||
// additional args passed in on looper cmd line | ||
// if the arg is {} then the files will be places there |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious. Any specific reason to use {}
as a placeholder?
Thanks. I've been meaning to add something like this, but I never settled on how it should work. |
|
||
runner := gat.Run{Tags: tags} | ||
// Pass all args to go test, except the name of the looper command | ||
gtargs := os.Args[1:len(os.Args)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
len(os.Args)
is the default [1:]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is "gt"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I have already fixed [1:]
on my end, I will push it.
gt
== GoTest. I just needed a prefix, I can be more verbose, or now that tags are gone it could just be args
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
args sounds good. thanks
Sorry, I seem to have introduce some conflicts in master. Do you mind removing the extra verbosity and fixing the conflicts? |
I do not mind, but will not be able to tackle it immediately. — On Sun, Aug 23, 2015 at 6:06 PM, Nathan Youngman [email protected]
|
Thanks. |
is this anywhere close to happen in the near future? ;) |
Add ability to pass arbitrary arguments to
go test
.As to not interfere with the current
looper
options you must prefix anygo test
options with the double hyphen (--
), ala:This really renders the
-tags
flag obsolete as it has the same format ingo test
; however removing it would be a breaking change for others.