format: update import statements order for consistency

This commit is contained in:
Sebastian Mark 2024-10-28 09:33:05 +01:00
parent 3a6be4c187
commit e2ab19066d
7 changed files with 16 additions and 15 deletions

View file

@ -3,13 +3,14 @@ package server
import ( import (
"flag" "flag"
"fmt" "fmt"
"github.com/charmbracelet/log"
"net/http"
"os"
"git.smsvc.net/pomodoro/GoTomato/internal/metadata" "git.smsvc.net/pomodoro/GoTomato/internal/metadata"
"git.smsvc.net/pomodoro/GoTomato/internal/shared" "git.smsvc.net/pomodoro/GoTomato/internal/shared"
"git.smsvc.net/pomodoro/GoTomato/internal/websocket" "git.smsvc.net/pomodoro/GoTomato/internal/websocket"
"git.smsvc.net/pomodoro/GoTomato/pkg/models" "git.smsvc.net/pomodoro/GoTomato/pkg/models"
"github.com/charmbracelet/log"
"net/http"
"os"
) )
func Start() { func Start() {

View file

@ -1,10 +1,11 @@
package pomodoro package pomodoro
import ( import (
"git.smsvc.net/pomodoro/GoTomato/internal/shared"
"git.smsvc.net/pomodoro/GoTomato/pkg/models"
"sync" "sync"
"time" "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 var mu sync.Mutex // to synchronize access to shared state

View file

@ -1,8 +1,6 @@
package pomodoro package pomodoro
import ( import "time"
"time"
)
type Timer struct { type Timer struct {
TimeLeft chan int // time left TimeLeft chan int // time left

View file

@ -1,8 +1,6 @@
package shared package shared
import ( import "git.smsvc.net/pomodoro/GoTomato/pkg/models"
"git.smsvc.net/pomodoro/GoTomato/pkg/models"
)
var DefaultServerConfig = models.ServerConfig{ var DefaultServerConfig = models.ServerConfig{
ListenAddress: "0.0.0.0", ListenAddress: "0.0.0.0",

View file

@ -2,10 +2,11 @@ package websocket
import ( import (
"encoding/json" "encoding/json"
"git.smsvc.net/pomodoro/GoTomato/internal/shared"
"github.com/charmbracelet/log" "github.com/charmbracelet/log"
"github.com/gorilla/websocket" "github.com/gorilla/websocket"
"time" "time"
"git.smsvc.net/pomodoro/GoTomato/internal/shared"
) )
// sends continous messages to all connected WebSocket clients. // sends continous messages to all connected WebSocket clients.

View file

@ -2,11 +2,12 @@ package websocket
import ( import (
"encoding/json" "encoding/json"
"github.com/charmbracelet/log"
"github.com/gorilla/websocket"
"git.smsvc.net/pomodoro/GoTomato/internal/pomodoro" "git.smsvc.net/pomodoro/GoTomato/internal/pomodoro"
"git.smsvc.net/pomodoro/GoTomato/internal/shared" "git.smsvc.net/pomodoro/GoTomato/internal/shared"
"git.smsvc.net/pomodoro/GoTomato/pkg/models" "git.smsvc.net/pomodoro/GoTomato/pkg/models"
"github.com/charmbracelet/log"
"github.com/gorilla/websocket"
) )
// handleClientCommands listens for commands from WebSocket clients // handleClientCommands listens for commands from WebSocket clients

View file

@ -1,11 +1,12 @@
package websocket package websocket
import ( import (
"git.smsvc.net/pomodoro/GoTomato/pkg/models"
"github.com/charmbracelet/log" "github.com/charmbracelet/log"
"github.com/gorilla/websocket" "github.com/gorilla/websocket"
"net/http" "net/http"
"sync" "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 // Clients is a map of connected WebSocket clients, where each client is represented by the Client struct