From 0e62a3b46b25e7c101b14ed44235f3c276982fc0 Mon Sep 17 00:00:00 2001 From: Mitch Riedstra Date: Fri, 19 Mar 2021 21:19:42 -0400 Subject: Sweeping changes to switch to bootstrap and make the UI overall a bit more user friendly --- cmd/web/main.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'cmd/web/main.go') diff --git a/cmd/web/main.go b/cmd/web/main.go index 45b64ae..da0bebd 100644 --- a/cmd/web/main.go +++ b/cmd/web/main.go @@ -5,10 +5,10 @@ import ( "flag" "fmt" "log" - "math/rand" "net/http" "os" - "time" + "strconv" + "strings" "github.com/gorilla/mux" ) @@ -66,8 +66,16 @@ func main() { err = s.ListenAndServe() if err != nil { Logger.Printf("Encountered: %s", err) - rand.Seed(time.Now().UnixNano()) - Listen = fmt.Sprintf(":%d", rand.Intn(9000)+1024) + + parts := strings.Split(Listen, ":") + port, err := strconv.Atoi(parts[1]) + if err != nil { + panic(err) + } + port += 1 + + Listen = fmt.Sprintf("%s:%d", parts[0], port) + Logger.Printf("Trying: %s", Listen) s.Addr = Listen } -- cgit v1.2.3