"go run" is mostly a convenience, and isn't meant to extend very far beyond a .go file or two.As soon a "run" can't do what you want, it's time to use "build" or "install"
As a followup question, though.Is go run not suitable during development, comparable to e.g. pressing F5 in qtcreator or visual studio?
#!/usr/bin/env bashEXE=monkey
while true; dofor SRC in $(find .. -name '*.go' -mmin -1); doif [ "$SRC" -nt "$EXE" ]; thenpkill -u $USER -f $EXE{ go build -o $EXE && echo "built successfully"; } || echo "build failed"./$EXE &datebreakfidonesleep 15done
I do something similar but rely on inotify tools to avoid the busy loop.
It is a very neat and light setup with close to IDE like power but much less hassle.
--
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...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.