From 6df7c52e9e4693b6b7554aeb5b5839ca7759aa39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milo=C5=A1=20Jovanovi=C4=87?= Date: Wed, 9 Sep 2026 22:53:38 +0200 Subject: [PATCH] goimports automating imports for me now --- client.go | 3 --- fakes.go | 5 ++--- server.go | 2 +- store.go | 7 +++---- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/client.go b/client.go index 4ee1759..0b50648 100644 --- a/client.go +++ b/client.go @@ -2,14 +2,11 @@ package main import ( "context" - "encoding/json" "fmt" "io" "log" "net/http" - "net/url" "strconv" - "strings" "time" "golang.org/x/time/rate" diff --git a/fakes.go b/fakes.go index 3995190..cbac13c 100644 --- a/fakes.go +++ b/fakes.go @@ -5,8 +5,8 @@ import ( ) type fakeST struct { - dept string - err error + dept string + err error chapterID int64 } @@ -16,4 +16,3 @@ func (f *fakeST) GetUser(ctx context.Context, id int64) (*User, error) { } return &User{ID: id, ChapterID: f.chapterID, Department: f.dept}, nil } - diff --git a/server.go b/server.go index e5e6f75..ddb3ee8 100644 --- a/server.go +++ b/server.go @@ -14,7 +14,7 @@ import ( // User is the subset of an ST user record this worker cares about. type User struct { ID int64 - Email string + Email string ChapterID int64 Department string } diff --git a/store.go b/store.go index baa3bb5..75bbd72 100644 --- a/store.go +++ b/store.go @@ -4,8 +4,7 @@ import ( "database/sql" "errors" - "modernc.org/sqlite" - sqlite3 "modernc.org/sqlite/lib" + sqlite3 "modernc.org/sqlite/lib" ) const schema = ` @@ -45,8 +44,8 @@ func (s *SQLStore) AcquireLock(chapterID int64, dept string, repID int64) (int64 if err != nil { var serr *sqLite.Error if errors.As(err, &serr) && serr.Code() == sqlite3.SQLITE_CONSTRAINT_UNIQUE { - return 0, ErrLocked - } + return 0, ErrLocked + } return 0, ErrLocked } return res.LastInsertId()