goimports automating imports for me now
This commit is contained in:
parent
68d0851552
commit
6df7c52e9e
4 changed files with 6 additions and 11 deletions
|
|
@ -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"
|
||||
|
|
|
|||
5
fakes.go
5
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
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
7
store.go
7
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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue