Skip to content

Commit

Permalink
clean up listener and exit in fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
avahowell committed May 27, 2017
1 parent 8964208 commit 30ce7db
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"log"
"net"
"net/http"
"os"

"github.com/skratchdot/open-golang/open"

Expand Down Expand Up @@ -103,12 +104,14 @@ func main() {

err = open.Run("http://localhost:8087")
if err != nil {
// fallback to console.
// fallback to console, clean up the server and exit
l.Close()
fmt.Println("Seed:", seedStr)
fmt.Println("Addresses:")
for _, address := range addresses {
fmt.Println(address)
}
os.Exit(0)
}
<-done
}

0 comments on commit 30ce7db

Please sign in to comment.