Commit 643c757d authored by ale's avatar ale

Golint fixes

parent 1de863a6
Pipeline #2474 passed with stage
in 14 seconds
......@@ -35,7 +35,7 @@ func (d *analysisService) CheckDevice(username string, deviceInfo *auth.DeviceIn
if err != nil {
return false, err
}
defer tx.Rollback()
defer tx.Rollback() // nolint
var seen bool
err = d.stmts.get(tx, "check_device_info").QueryRow(username, deviceInfo.ID).Scan(&seen)
......
......@@ -65,7 +65,7 @@ func (l *lastloginDB) AddLastLogin(entry *usermetadb.LastLoginEntry) error {
if err != nil {
return err
}
defer tx.Rollback()
defer tx.Rollback() // nolint
stmt := "insert_or_replace_last_login"
args := []interface{}{
......@@ -87,7 +87,7 @@ func (l *lastloginDB) GetLastLogin(username string, service string) ([]*usermeta
if err != nil {
return nil, err
}
defer tx.Rollback()
defer tx.Rollback() // nolint
var stmt string
var args []interface{}
......
......@@ -68,13 +68,13 @@ func TestServer_AddLastLogin(t *testing.T) {
}
}
exp_resp := *entries[0]
resp, err := c.GetLastLogin(context.Background(), "", exp_resp.Username, exp_resp.Service)
expResp := *entries[0]
resp, err := c.GetLastLogin(context.Background(), "", expResp.Username, expResp.Service)
if err != nil {
t.Fatal(err)
}
if *resp[0] != exp_resp {
t.Fatalf("Last login entries differ:\nSet %v\nGot %v", exp_resp, *resp[0])
if *resp[0] != expResp {
t.Fatalf("Last login entries differ:\nSet %v\nGot %v", expResp, *resp[0])
}
}
......@@ -33,7 +33,7 @@ func choose(l []string) string {
func generateRandomDeviceInfo() *auth.DeviceInfo {
var buf [8]byte
crand.Read(buf[:])
crand.Read(buf[:]) // nolint
id := hex.EncodeToString(buf[:])
return &auth.DeviceInfo{
ID: id,
......@@ -101,6 +101,7 @@ func bulkLoadTestLogs(t testing.TB, db *sql.DB) *usermetadb.LogEntry {
now := time.Now()
for username, devs := range userDevices {
for _, dev := range devs {
// nolint
insertDeviceInfoStmt.Exec(
username,
dev.ID,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment