go-reload
go-reload copied to clipboard
It doesn't work on ubuntu 14.04 with inotifywait 3.14
Nothing happens when go-file changed.
Operating system: Ubuntu 14.04
Hi,
Can you provide more information? What's your directory structure? What command are you using to run it? Also, what version of Go are you using and do you have modules enabled?
Cheers!
Hi,
- Ubuntu 14.04 is a subsystem on Windows 10.
- Go version: 1.12.1
- Command used: $ go-reload main.go
- Directory is simple that inside GOPATH. Ex."/mnt/i/goProjects" Only one file in that folder named "main.go". See code below.
` package main
import ( "fmt" "net/http" )
func test(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "Change me1") }
func main() { server := http.Server{ Addr: "127.0.0.1:8080", }
http.HandleFunc("/", test)
server.ListenAndServe()
} `
I've tried the code you posted, using Ubuntu 18.10 and Go 1.12, both in a directory under GOPATH and also using the new module style. I haven't been able to replicate the problem, for me the server is being restarted whenever the main.go code is changed.
$ go-reload main.go
== Go-reload
>> Watching directories, CTRL+C to stop
signal: killed
>> Reloading...
What output do you get when you run the following commands?
$ which inotifywait
$ echo $GOPATH
Please see info below.
$ which inotifywait
/usr/bin/inotifywait
$ echo $GOPATH
/mnt/c/Users/robert/i/goProjects
$ inotifywait .
Setting up watches.
Watches established.
./ MODIFY main.go