the code is hello world at 127.0.0.1:8080 via http.ListenAndServe (": 8080", nil). I compile, I launch in the terminal (Ubuntu 14.04). I go to the browser - everything is fine. I interrupt the execution in the terminal, change the code, compile, execute - it writes: ListenAndServe: listen tcp: 8080: bind: address already in use. If you close / open the terminal - everything works. How can you work in one terminal window without closing it?
2 answers
Make a timeout instead of nil http://habrahabr.ru/post/197468/
|
Use better go run <program name>
|