go-reload icon indicating copy to clipboard operation
go-reload copied to clipboard

It doesn't work on ubuntu 14.04 with inotifywait 3.14

Open baybird opened this issue 6 years ago • 4 comments

Nothing happens when go-file changed.

Operating system: Ubuntu 14.04

baybird avatar Mar 20 '19 15:03 baybird

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!

alexedwards avatar Mar 20 '19 19:03 alexedwards

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()

} `

baybird avatar Mar 20 '19 23:03 baybird

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

alexedwards avatar Mar 23 '19 13:03 alexedwards

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

baybird avatar Mar 23 '19 17:03 baybird