From e2ab19066d563d0398f2159e5159caf64b5f8f9f Mon Sep 17 00:00:00 2001 From: Sebastian Mark Date: Mon, 28 Oct 2024 09:33:05 +0100 Subject: [PATCH] format: update import statements order for consistency --- cmd/server/main.go | 7 ++++--- internal/pomodoro/pomodoro.go | 5 +++-- internal/pomodoro/timer.go | 4 +--- internal/shared/configDefaults.go | 4 +--- internal/websocket/broadcast.go | 3 ++- internal/websocket/client_commands.go | 5 +++-- internal/websocket/handle_connections.go | 3 ++- 7 files changed, 16 insertions(+), 15 deletions(-) diff --git a/cmd/server/main.go b/cmd/server/main.go index 9f9db88..67fba91 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -3,13 +3,14 @@ package server import ( "flag" "fmt" + "github.com/charmbracelet/log" + "net/http" + "os" + "git.smsvc.net/pomodoro/GoTomato/internal/metadata" "git.smsvc.net/pomodoro/GoTomato/internal/shared" "git.smsvc.net/pomodoro/GoTomato/internal/websocket" "git.smsvc.net/pomodoro/GoTomato/pkg/models" - "github.com/charmbracelet/log" - "net/http" - "os" ) func Start() { diff --git a/internal/pomodoro/pomodoro.go b/internal/pomodoro/pomodoro.go index c24d4a5..6b83842 100644 --- a/internal/pomodoro/pomodoro.go +++ b/internal/pomodoro/pomodoro.go @@ -1,10 +1,11 @@ package pomodoro import ( - "git.smsvc.net/pomodoro/GoTomato/internal/shared" - "git.smsvc.net/pomodoro/GoTomato/pkg/models" "sync" "time" + + "git.smsvc.net/pomodoro/GoTomato/internal/shared" + "git.smsvc.net/pomodoro/GoTomato/pkg/models" ) var mu sync.Mutex // to synchronize access to shared state diff --git a/internal/pomodoro/timer.go b/internal/pomodoro/timer.go index 55cb654..c80f288 100644 --- a/internal/pomodoro/timer.go +++ b/internal/pomodoro/timer.go @@ -1,8 +1,6 @@ package pomodoro -import ( - "time" -) +import "time" type Timer struct { TimeLeft chan int // time left diff --git a/internal/shared/configDefaults.go b/internal/shared/configDefaults.go index a3840e0..9366889 100644 --- a/internal/shared/configDefaults.go +++ b/internal/shared/configDefaults.go @@ -1,8 +1,6 @@ package shared -import ( - "git.smsvc.net/pomodoro/GoTomato/pkg/models" -) +import "git.smsvc.net/pomodoro/GoTomato/pkg/models" var DefaultServerConfig = models.ServerConfig{ ListenAddress: "0.0.0.0", diff --git a/internal/websocket/broadcast.go b/internal/websocket/broadcast.go index 99827e7..64b8fb4 100644 --- a/internal/websocket/broadcast.go +++ b/internal/websocket/broadcast.go @@ -2,10 +2,11 @@ package websocket import ( "encoding/json" - "git.smsvc.net/pomodoro/GoTomato/internal/shared" "github.com/charmbracelet/log" "github.com/gorilla/websocket" "time" + + "git.smsvc.net/pomodoro/GoTomato/internal/shared" ) // sends continous messages to all connected WebSocket clients. diff --git a/internal/websocket/client_commands.go b/internal/websocket/client_commands.go index c1f323f..472484f 100644 --- a/internal/websocket/client_commands.go +++ b/internal/websocket/client_commands.go @@ -2,11 +2,12 @@ package websocket import ( "encoding/json" + "github.com/charmbracelet/log" + "github.com/gorilla/websocket" + "git.smsvc.net/pomodoro/GoTomato/internal/pomodoro" "git.smsvc.net/pomodoro/GoTomato/internal/shared" "git.smsvc.net/pomodoro/GoTomato/pkg/models" - "github.com/charmbracelet/log" - "github.com/gorilla/websocket" ) // handleClientCommands listens for commands from WebSocket clients diff --git a/internal/websocket/handle_connections.go b/internal/websocket/handle_connections.go index 687f472..4b5f1b1 100644 --- a/internal/websocket/handle_connections.go +++ b/internal/websocket/handle_connections.go @@ -1,11 +1,12 @@ package websocket import ( - "git.smsvc.net/pomodoro/GoTomato/pkg/models" "github.com/charmbracelet/log" "github.com/gorilla/websocket" "net/http" "sync" + + "git.smsvc.net/pomodoro/GoTomato/pkg/models" ) // Clients is a map of connected WebSocket clients, where each client is represented by the Client struct