Will autobuild and kill/relaunch the target when you update the code.

Overview

Use like rerun github.com/skelterjohn/go.uik/uiktest

Usage: rerun [--test] [--build] [--race] [--no-run] <import path> [arg]*

For any go executable in a normal GOPATH workspace, rerun will watch its source, rebuild, retest, and rerun. As long as go install <import path> works, rerun will be able to find it.

Along with the target's source, rerun also watches the source of all the target's non-GOROOT dependencies.

When using flag --test, rerun executes go test. If tests fail, rerun will not continue to build and/or run the program.

Flag --build makes rerun execute go build in the local folder, creating an executable.

Flag --no-run omits actually running the program. This is useful if you only wish to test and/or build.

Flag --race will test/build/run the program with race detection enabled.

Comments
  • random failed rerun some package(http.ListenAndServe)

    random failed rerun some package(http.ListenAndServe)

    sometime rerun can not continue with this problem: 2013/07/05 16:29:08 ListenAndServe: listen tcp :80: Only one usage of each socket address (protocol/network address/port) is normally permitted.

    opened by zx9597446 9
  • Add ability to connect to network listener for events

    Add ability to connect to network listener for events

    Development on remote hosts or docker containers often don't have access to the original file events. Ruby's listen gem provides a way to forward events over a TCP socket, and there is now a golang implementation of the same thing.

    This PR adds a -connect argument that can connect to a TCP socket and receive remote events. When used, it replaces the local FS watch.

    opened by lox 2
  • Added support for the GOBIN environment variable.

    Added support for the GOBIN environment variable.

    Added support for the GOBIN environment variable. "If the GOBIN environment variable is set, commands are installed to the directory it names instead of DIR/bin" (http://golang.org/cmd/go/#hdr-GOPATH_environment_variable). Added error logging on cmd.Start()

    opened by GeertJohan 2
  • Send stdin to running process

    Send stdin to running process

    opened by pwaller 1
  • Added support for graceful shutdown of go applications.

    Added support for graceful shutdown of go applications.

    Now using interrupt signal with fallback to proc.Kill(). Related to #11. Don't know if this will work for all go programs out there. This patch assumes that the interrupt signal isn't (ab)used for other purposes than killing (such as reporting program status).

    opened by GeertJohan 1
  • fix bin path issue when the path contains the package path also

    fix bin path issue when the path contains the package path also

    Due to issues with windows not finding executable due to the '.exe' extension, added a small fix for windows runtime checks, also extended the library to provide more features by creating https://github.com/influx6/watch from this code. Thanks

    opened by influx6 0
  • Stop application instance before build

    Stop application instance before build

    At this moment, the application instance keeps running when a build fails (after a .go file changed). I believe it would be better to kill the instance on each build (and hence have no application running when the build fails). For starters because rerun is here to have a running application that matches the source. And also because log messages of the application instance can easily take the build errors out of view.

    I think the new execution flow could be something like:

    for {
      // wait for change on cmd source or imported pkg source
      <-sourceChangedChannel
    
      // stop the existing cmd instance (preferably in a graceful way)
      stopExistingInstance()
    
      // build whats required to build
      // (I'm not sure if dependency building is really working good now.. 
      //    but that would be a different issue)
      build()
    
      if build failed {
        // show build output (just like now)
        showErrors()
        continue
      }
    
      // only start new instance if the build succeeded (just like now)
      startNewInstance()
    }```
    
    opened by GeertJohan 0
  • Changed CLI help display code, and added option to ignore names by regexp.

    Changed CLI help display code, and added option to ignore names by regexp.

    Hi John,

    Here's the modifications I made, in addition to Lachlan's:

    • I changed help display code to use standard "flag" module's facility, to avoid having to update that one "Usage:" line every time there's a new flag.
    • Added a flag to ignore files by regexp pattern; without it rerun also monitors temp files whose name merely prefixed (like emacs'). On malformed regexp, print error and ignore the regexp. I only need to check prefix, but this way maybe it'd be a bit more useful.
    opened by adhihargo 1
  • Panics on sleep/wake

    Panics on sleep/wake

    panic: runtime error: invalid memory address or nil pointer dereference
    [signal 0xb code=0x1 addr=0x20 pc=0x77678]
    
    goroutine 1 [running]:
    panic(0x1a6460, 0x820340100)
        /usr/local/Cellar/go/1.6/libexec/src/runtime/panic.go:464 +0x3e6
    github.com/howeyc/fsnotify.(*Watcher).removeWatch(0x8207ba000, 0x8208f3700, 0x3b, 0x0, 0x0)
        /Users/rob/go/src/github.com/howeyc/fsnotify/fsnotify_bsd.go:269 +0x878
    github.com/howeyc/fsnotify.(*Watcher).Close(0x8207ba000, 0x0, 0x0)
        /Users/rob/go/src/github.com/howeyc/fsnotify/fsnotify_bsd.go:128 +0x1ac
    main.rerun(0x7fff5fbfee60, 0x27, 0x8203382d0, 0x0, 0x0, 0x0, 0x0)
        /Users/rob/go/src/github.com/skelterjohn/rerun/rerun.go:226 +0x7ad
    main.main()
        /Users/rob/go/src/github.com/skelterjohn/rerun/rerun.go:283 +0x289
    

    It looks like this happens only on sleep/wake, as I've noticed it every time I leave rerun up and re-open my laptop.

    Possibly a signal is being passed that's missing some attributes? Or a unexpected signal? This is not a big deal for my use case, but I thought I'd report it anyways.

    OSX 10.9.5, rerun revision e317af9469ea6d0a63244f7b985660062610237c.

    opened by robbles 1
  • Support tcp connect as an alternative to local filesystem watching

    Support tcp connect as an alternative to local filesystem watching

    A common development environment (at least under OSX) is to use a virtual machine to run a development environment and use NFS or another network filesystem to mount your code locally for editing.

    The issue with this and reloaders like rerun is that notifications don't pass over NFS. This is a common problem documented in the ruby listen gem, which provides a basic protocol for forwarding generic filesystem change events over TCP.

    What this pull request implements is a -connect option that connects to a TCP event stream, and uses these events instead of watching for local events.

    Consider this scenario:

    host1> listen --forward :4000 -d .  
    host2> rerun -connect host1:4000 github.com/lox/exampleapp
    

    Rerun connects to the server that listen starts, and when files change on host1, they are passed to host2 to trigger a reload. Because the filesystems are shared over NFS between the hosts, the changed code is there.

    opened by lox 0
  • Not reloading?

    Not reloading?

    I'm running this in a docker container on a project i'm working on.

    [email protected]:/go/src/github.com/crsmithdev/app-template# rerun github.com/crsmithdev/app-template
    2015/05/09 18:07:37 setting up github.com/crsmithdev/app-template []
    2015/05/09 18:07:38 [app-template]
    starting
    

    However, touching or editing main.go doesn't produce a reload, it only changes when i ctrl-C and rerun again.

    opened by crsmithdev 5
Owner
John Asmuth
John Asmuth
go-pry - an interactive REPL for Go that allows you to drop into your code at any point.

go-pry go-pry - an interactive REPL for Go that allows you to drop into your code at any point. Example Usage Install go-pry go get github.com/d4l3k/g

Tristan Rice 2.9k Nov 26, 2022
Aegis is a library that allows you detect if your software is being debugged or not on Linux, FreeBSD, NetBSD, OpenBSD and Windows

Aegis is a library that allows you detect if your software is being debugged or not on Linux, FreeBSD, NetBSD, OpenBSD and Windows. You can use it natively from C or use the Go bind.

Rafael Santiago 28 Aug 29, 2022
A program to build, run, and restart a Go program on code change

devrun A program to build, run, and restart a Go program on code change. It also supports watching all your Go imports too. So if you change the code

Kevin Darlington 19 Apr 4, 2022
Yet another Go REPL that works nicely. Featured with line editing, code completion, and more.

gore Yet another Go REPL that works nicely. Featured with line editing, code completion, and more. (Screencast taken with cho45/KeyCast) Usage gore Af

Hironao OTSUBO 4.7k Nov 30, 2022
Generate code for any language, with any language.

gocog - generate code for any language, with any language gocog v1.0 build 20130206 Binaries for popular OSes are available on the Downloads page of t

Nate Finch 66 Aug 5, 2022
Go package for syntax highlighting of code

syntaxhighlight Package syntaxhighlight provides syntax highlighting for code. It currently uses a language-independent lexer and performs decently on

Sourcegraph 253 Nov 18, 2022
🔥 Continuous profiling platform — debug performance issues in your code!

Pyroscope is an open source continuous profiling platform.

Pyroscope 6.7k Dec 6, 2022
Simple tool that updates Visual Studio Code workspace(s) to include Go modules in gopath/src, then launches VSCode if only one modified.

Simple tool that updates Visual Studio Code workspace(s) to include Go modules in gopath/src, then launches VSCode if only one modified.

Valérie 0 Jan 27, 2022
Go structure annotations that supports encoding and decoding; similar to C-style bitfields. Supports bitfield packing, self-describing layout parameters, and alignment.

STRUCTure EXtensions structex provides annotation rules that extend Go structures for implementation of encoding and decoding of byte backed data fram

Hewlett Packard Enterprise 54 Oct 13, 2022
ide-gen is a tool for development workspace prepare automation by automatic VCS repositories discovery and clone and project generation for supported IDEs.

ide-gen is a tool for development workspace prepare automation by automatic VCS repositories discovery and clone and project generation for supported IDEs.

null 8 May 8, 2022
Download, build, cache and run a Go app easily.

demand -- An easy way to install apps demand will download, build, cache and run a Go app. You can use it as an interpreter. Create a file bytes2human

Tv 12 Sep 10, 2017
cmd tool for automatic storage and comparison of benchmarks results

prettybenchcmp prettybenchcmp is cmd tool for storage and comparison of benchmarks results. There is a standard tool benchcmp, but I don't think that

Petr 18 Apr 6, 2021
golang feature toggle library - a library to help make golang feature toggling clean and easy

toggle supports env_variable backed toggling. It can also be updated via a pubsub interface (tested w/ redis) 2 engines for toggle backing are include

John Calabrese 24 Mar 29, 2022
Docker For Go Application Packaging And Pushing To Docker Hub

DOCKER-FOR-GO-APPLICATION-PACKAGING-AND-PUSHING-TO-DOCKER-HUB ##DOCKER COMMANDS: (Don't forget to navigate to the directory that contains the app and

ANDRÉS R. BUCHELI (Andrés F. Regalado Bucheli) 1 Jan 22, 2022
Template project to get started with a simple API skeleton in Go and Docker

A template project to create a Docker image for a Go application. The example application exposes an HTTP endpoint through a REST API packaged as a static binary.

Harsh Mishra 11 Apr 4, 2022
A simple application to show how to use dd-trace-go's tracer and profiler.

dd-trace-go-demo A simple application to show how to use dd-trace-go's tracer and profiler. Usage To run this demo application, simply clone this repo

Felix Geisendörfer 4 Oct 8, 2022
Pure Go command line prompt with history, kill-ring, and tab completion

Prompt Prompt is a command line prompt editor with history, kill-ring, and tab completion. It was inspired by linenoise and derivatives which eschew u

Peter Mattis 1 Nov 20, 2021
mass-binding-target is a command line tool for generating binding target list by search plot files from disk.

mass-binding-target mass-binding-target is a command line tool for generating binding target list by search plot files from disk. Build Go 1.13 or new

null 0 Nov 5, 2021
Myretail-target-case-study - Case study assessment for Target.com

myRetail This project contains two solutions to the Target myRetail case study. The prompt is copied over to PROMPT.md for convenience, but the TLDR i

Andrey Kaipov 1 Jan 1, 2022