Reload a specified go program automatically by monitoring a directory.

gowatcher

A bash script to automatically reload a go program when .go or .html files change in the monitored directory. It uses inotify.

Installation

Do you have inotify-tools already installed? Great, then skip step 1.

Step 1: (installing the dependency)

$ sudo apt-get install inotify-tools

Replace apt-get install with whatever package manager you use.

Step 2: (downloading and preparing the script)

$ curl http://raw.github.com/nickjj/gowatcher/gowatcher > gowatcher && chmod 700 gowatcher

That just grabs the latest copy from this repo and changes the privileges of the file so that it is executable.

At this point you'll want to move gowatcher into a directory that is on your system path so that you can run it from any directory.

You're also done unless you do not know how to do that, in which case continue onto step 3.

Step 3: (setting a directory on your system path)

If you do not have any directories on your system path it is pretty common to add a bin folder in your home directory. You can do that if you like and then at the bottom of your .bashrc file you can add:

export PATH=/home/username/bin

If you have one path there already you can separate it by a colon. Example:

export PATH=/home/username/bin:/some/other/path

Where username is your actual username, then save the file and reload your shell by doing:

$ source ~/.bashrc

Usage

$ cd path/to/the/dir/you/want/to/watch
$ gowatcher file-to-start.go

In other words, goto the directory you want to monitor and input the path to the go file containing your main() function.

Owner
Nick Janetakis
Currently a self employed freelance developer & teacher. I mainly work with Flask, Rails, Phoenix, Bash, Docker, Ansible & Terraform. Also a @docker captain.
Nick Janetakis
Similar Resources

Live reload utility for Go web servers

gin gin is a simple command line utility for live-reloading Go web applications. Just run gin in your app directory and your web app will be served wi

Jan 4, 2023

☁️ Live reload for Go apps

☁️ Live reload for Go apps

Air ☁️ Live reload for Go apps Motivation When I get started with developing websites in Go and gin framework, it's a pity that gin lacks live-reloadi

Jan 1, 2023

Ambiente com Docker de "live-reload" para aplicações Go

Ambiente Go Um ambiente de "live reload", onde as alterações no código são observadas e re-executadas automaticamente, com Docker e Docker Compose. O

Jun 17, 2022

Sidecar to watch a config folder and reload a process when it changes

A small (3MB uncompressed docker image), efficient (via inotify) sidecar to trigger application reloads when configuration changes.

Dec 29, 2022

A local server with real-time reload function designed for static website preview or development

中文 | English 📝 介绍 reserver 是一款为静态网站预览或开发设计的具有实时重新加载功能的本地服务器。 其主要运用场景为: 单页应用的预览(例如Vue编译之后的项目不可以直接通过file://协议进行访问) 具有ajax请求的页面(因浏览器安全限制,默认禁止file://协议进行

Aug 23, 2022

GCP Cloud Functions ready to Go starter with hot reload 🔥

GCP Cloud Functions - Go Starter Features: funcFramework already set up - ready for local development and testing. Hot Reload ready-to-go thanks to th

Dec 16, 2021

🔎 gowatch Live reload for go apps.

Watch 🔎 gowatch Live reload for go apps Motivation I had no app to live reload my Go programs. Usage Install go install github.com/gelfand/gowatch ◆

Dec 29, 2021

Golang http&grpc server for gracefully shutdown like nginx -s reload

supervisor Golang http & grpc server for gracefully shutdown like nginx -s reload if you want a server which would be restarted without stopping servi

Jan 8, 2022

This is a hot reload tooling for go

hotpocket This is a hot reload tooling for go Usage First need to have a json file in the root of your project. Name it as a hotpocket.json. It Should

Jul 17, 2022

Monitoriamento-go - Program for monitoring websites in Golang

***Programa para monitoriamento de sites em Go lang. *** No "sitesaqui.txt" colo

Feb 2, 2022

A little opinionated program to automatically provision my Aerohive APs without HiveManager/ExtremeCloud IQ

Aerohive Provision A little opinionated program to automatically provision my Aerohive APs without HiveManager/ExtremeCloud IQ. Unfortunately a lot of

Nov 28, 2022

CLI Program for setting League Of Legends runes automatically. Written in Golang.

SimplyRunes CLI Program for setting League Of Legends runes automatically. Written in Golang. I made this, because I was tired of other apps like Poro

Feb 21, 2022

A simple program to automatically backup a database using git. Err handling by Sentry, Reporting by Betteruptime. Made with 🩸 , 😓 & 😭

backup What is this? A Simple program to automatically backup a database using git. Err handling by Sentry, Uses heartbeats by Betteruptime Made with

Nov 4, 2022

Implements the XDR standard as specified in RFC 4506 in pure Go (Golang)

go-xdr [] (https://travis-ci.org/davecgh/go-xdr) [![Coverage Status] (https://coveralls.io/repos/davecgh/go-xdr/badge.png?branch=master)] (https://cov

Dec 15, 2022

:runner:runs go generate recursively on a specified path or environment variable and can filter by regex

Package generate Package generate runs go generate recursively on a specified path or environment variable like $GOPATH and can filter by regex Why wo

Sep 27, 2022

A commandline tool to resolve URI Templates expressions as specified in RFC 6570.

URI Are you tired to build, concat, replace URL(s) (via shell scripts sed/awk/tr) from your awesome commandline pipeline? Well! here is the missing pi

Jun 9, 2021

A concurrent map with entries expiring after a specified interval.

go-ttlmap Go TTL Map is a concurent map with entries expiring after a specified interval. This package requires go1.14 or newer. Overview This impleme

Oct 13, 2021

daemon for removing torrents from deluge after a specified timeframe

deluge-remove-after -- daemon for removing torrents from deluge after a specified timeframe Table of Contents Why Installation Docker Build from sourc

Jul 10, 2022

Server that forwards the tx to the specified smart contract

tx-forwarder Server that forwards the tx to the specified smart contract. Usage In production use ./tx-forwarder, in development use go run main.go in

Dec 6, 2021
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

Apr 4, 2022
Automatically generate RESTful API documentation with Swagger 2.0 for Go.
Automatically generate RESTful API documentation with Swagger 2.0 for Go.

Automatically generate RESTful API documentation with Swagger 2.0 for Go.

Jan 9, 2023
Visualize call graph of a Go program using Graphviz
Visualize call graph of a Go program using Graphviz

go-callvis go-callvis is a development tool to help visualize call graph of a Go program using interactive view. Introduction The purpose of this tool

Jan 1, 2023
Attach services to specified networks automatically

Docker swarm network attacher Description docker-swarm-network-attacher aims to solve the problem of sharing a network between unrelated services. Wit

Nov 11, 2021
Tool for monitoring network devices (mainly using SNMP) - monitoring check plugin
Tool for monitoring network devices (mainly using SNMP) - monitoring check plugin

Thola Description A tool for monitoring network devices written in Go. It features a check mode which complies with the monitoring plugins development

Dec 29, 2022
Monitoring-go - A simple monitoring tool to sites of MOVA

Monitoring GO A simple monitoring tool to sites of MOVA How to use Clone Repo gi

Feb 14, 2022
Monitoring changes in the source file and automatically compile and run (restart).
Monitoring changes in the source file and automatically compile and run (restart).

dogo Monitoring changes in the source file and automatically compile and run (restart). 中文 Install go get github.com/liudng/dogo Create config Here's

Dec 28, 2022
Monitoring changes in the source file and automatically compile and run (restart).
Monitoring changes in the source file and automatically compile and run (restart).

dogo Monitoring changes in the source file and automatically compile and run (restart). 中文 Install go get github.com/liudng/dogo Create config Here's

Dec 28, 2022
Live reload for Go web development

livedev livedev is a development proxy server for golang that allows live reloading. It supports multiple server configuration. It uses the request's

Jun 17, 2022
Reload Go code in a running process at function/method level granularity

got reload? Function/method-level stateful hot reloading for Go! Status Very much work in progress.

Nov 9, 2022