On Tuesday, 18 October 2016 14:02:08 UTC-5, Zellyn wrote:
> I run go tests with something like this:
> while true; do go test ./foo/bar; fswatch -1 -r . > /dev/null; sleep 0.3; 
> done
> It would be nice if go test could do that itself. (The 0.3 second sleep is 
> to let the file-write that triggered the test complete.)

I've built a tool for myself based on Watch by Russ Cox (he showed it in 
this video http://research.swtch.com/acme)

Located at: https://github.com/loov/watchrun

*$ go get github.com/loov/watchrun*
*$ watchrun go test ./foo/bar*

Keeping it as a separate tool is much more flexible and useful... e.g.

*$ watchrun go build myapp ;; myapp*

Which would build the application and then start it. Or... chain it with 
code generation...

*$ watchrun go generate . ;; go build . ;; myapp*

etc... of course depending on your needs you may want some other features 
or an alternative implementation.

> On Tuesday, October 18, 2016 at 2:54:49 PM UTC-4, Jaana Burcu Dogan wrote:
>> Hello gophers,
>> I am going to spend some time on improving the not-documented or 
>> hard-to-use parts of the Go tools. I will mainly focus on go build and go 
>> test. The work will consist of reorganizing manuals, proposing new 
>> subcommands or flags to support commonly used multi-step things and so on.
>> To give you some concrete examples:
>> I have been in cases where users cannot find the build flags because they 
>> are hidden. E.g.
>>     $ go test -help
>>     test [build/test flags] [packages] [build/test flags & test binary 
>> flags]
>>     ...
>> requires you to know about where the build flags are. Some tools are 
>> invisible for the newcomers.
>> The other example is about test coverage. It is so tedious that I need an 
>> alias.
>> func gocover() {
>>     go test -v -coverprofile=coverage.out && go tool cover 
>> -html=coverage.out
>> } 
>> I want to learn more about your experience, aliases, etc to propose 
>> improvements and work on the most commonly suggested items. I also am 
>> planning to go through this mailing list, stack overflow and other channels 
>> to see the common complaints.
>> Feel free to reply to this thread or write to me privately.
>> Thanks,
>> JBD

You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to