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

Print kills the hot reload #7

Open
Zeychiel opened this issue Jul 26, 2019 · 1 comment
Open

Print kills the hot reload #7

Zeychiel opened this issue Jul 26, 2019 · 1 comment

Comments

@Zeychiel
Copy link

Zeychiel commented Jul 26, 2019

Hi there,
Not sure if this is still maintained, but if yes, here is a bug that I cannot understand in your example:
If you add a fmt.Println("someText") in the main, the hot reload will silently fail. It seems that the binary is not run by yolo

func main() {
    fmt.Println("OK1")
    http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
        fmt.Fprintf(w, "message2")
    })

    http.ListenAndServe(":8080", nil)
}

I'd be glad to help if you have any idea why

@Zeychiel
Copy link
Author

It seems like this bug comes from any messing with stdout ; it is solved by redirecting the stdout to a file for example:
@-$(GOBIN)/$(PROJECTNAME) > /tmp/log.out 2>&1 & echo $$! > $(PID)

@Zeychiel Zeychiel changed the title Printing killing the hot reload Print kills the hot reload Jul 29, 2019
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

1 participant