Fresh is a command line tool that builds and (re)starts your web application everytime you save a Go or template file.
If the web framework you are using supports the Fresh runner, it will show build errors on your browser.
go get github.com/pilu/fresh
Fresh will watch for file events, and every time you create/modifiy/delete a file it will build and restart the application.
go build returns an error, it will log it in the tmp folder.
Traffic already has a middleware that shows the content of that file if it is present. This middleware is automatically added if you run a Traffic web app in dev mode with Fresh.
_examples folder if you want to use it with Martini or Gocraft Web.
You can use the
-c options if you want to specify a config file:
fresh -c runner.conf
Here is a sample config file with the default settings:
root: . tmp_path: ./tmp build_name: runner-build build_log: runner-build-errors.log invalid_regexp: ^\\..*, ^#.*, ^~.*, .*~$, ^flymake.*\\.go valid_regexp: .*\\.go$ valid_ext: .go, .tpl, .tmpl, .html build_delay: 600 colors: 1 log_color_main: cyan log_color_build: yellow log_color_runner: green log_color_watcher: magenta log_color_app:
regexp monitoring files.(regexp has the highest priority as it can describe more precisely.)
black list first (logic: AND)
(default is suitable for most cases: all hidden files and temporary files and flymake* files) (don't forget to prefix "^" to your regexp(meaning: matches from start)) invalid_regexp: ^\\..*, ^#.*, ^~.*, .*~$, ^flymake.*\\.go
white list (logic: OR)
(default is all .go file) valid_regexp: .*\\.go$
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request