Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It doesn't work on ubuntu 14.04 with inotifywait 3.14 #9

Open
baybird opened this issue Mar 20, 2019 · 4 comments
Open

It doesn't work on ubuntu 14.04 with inotifywait 3.14 #9

baybird opened this issue Mar 20, 2019 · 4 comments

Comments

@baybird
Copy link

baybird commented Mar 20, 2019

Nothing happens when go-file changed.

Operating system: Ubuntu 14.04

@alexedwards
Copy link
Owner

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!

@baybird
Copy link
Author

baybird commented Mar 20, 2019

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

}
`

@alexedwards
Copy link
Owner

alexedwards commented Mar 23, 2019

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

@baybird
Copy link
Author

baybird commented Mar 23, 2019

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 baybird changed the title It doesn't work. It doesn't work on ubuntu 14.04 with inotifywait 3.14 Mar 24, 2019
baybird added a commit to baybird/go-reload that referenced this issue Mar 24, 2019
doen't work on Ubuntu 14.04 with inotifywait 3.14.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants