#!/bin/sh

while true; do
	go run main.go -w
	if [ $? != 0 ] ; then
		exit
	fi
	echo restarting
done

#!/bin/sh

while true; do
	go run -race main.go -w
	if [ $? != 0 ] ; then
		exit
	fi
	echo restarting
done

Enable race detector during run
Enable race detector during run
