Skip to content

Commit 0511969

Browse files
committed
chore: make linter happy
1 parent 03fff21 commit 0511969

30 files changed

+56
-55
lines changed

cmd/info.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ student name --- get info for student.`,
7373
log.Fatal(err)
7474
}
7575

76-
defer f.Close()
76+
defer f.Close() //nolint:errcheck
7777

7878
_, err2 := f.Write(formatted_data)
7979

db/constraints.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ func (db *DB) GetConstraints(ctx context.Context) ([]*model.Constraints, error)
325325
log.Error().Err(err).Str("semester", db.semester).Str("collection", collectionConstraints).Msg("MongoDB Find")
326326
return constraints, err
327327
}
328-
defer cur.Close(ctx)
328+
defer cur.Close(ctx) //nolint:errcheck
329329

330330
// TODO: replace all cur.Next with cur.All
331331
for cur.Next(ctx) {

db/exam.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func (db *DB) AdditionalExams(ctx context.Context) ([]*model.AdditionalExam, err
3434
log.Error().Err(err).Str("semester", db.semester).Str("collection", collectionNameAdditionalExams).Msg("MongoDB Find")
3535
return exams, err
3636
}
37-
defer cur.Close(ctx)
37+
defer cur.Close(ctx) //nolint:errcheck
3838

3939
for cur.Next(ctx) {
4040
var exam model.AdditionalExam
@@ -146,7 +146,7 @@ func (db *DB) ExamsWithRegs(ctx context.Context) ([]*model.ExamWithRegs, error)
146146
log.Error().Err(err).Str("semester", db.semester).Str("collection", collectionNameExamsWithRegs).Msg("MongoDB Find")
147147
return exams, err
148148
}
149-
defer cur.Close(ctx)
149+
defer cur.Close(ctx) //nolint:errcheck
150150

151151
for cur.Next(ctx) {
152152
var exam model.ExamWithRegs
@@ -179,7 +179,7 @@ func (db *DB) ExamsInPlan(ctx context.Context) ([]*model.ExamInPlan, error) {
179179
if err != nil {
180180
log.Error().Err(err).Msg("error while trying to find exams in plan")
181181
}
182-
defer cur.Close(ctx)
182+
defer cur.Close(ctx) //nolint:errcheck
183183

184184
exams := make([]*model.ExamInPlan, 0)
185185

db/exam_cache.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func (db *DB) CachedExams(ctx context.Context) ([]*model.Exam, error) {
4343
log.Error().Err(err).Msg("cannot get cached exams")
4444
return nil, err
4545
}
46-
defer cur.Close(ctx)
46+
defer cur.Close(ctx) //nolint:errcheck
4747

4848
exams := make([]*model.Exam, 0)
4949

db/exam_connected.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func (db *DB) GetConnectedExams(ctx context.Context) ([]*model.ConnectedExam, er
107107
log.Error().Err(err).Str("semester", db.semester).Str("collection", collectionNameConnectedExams).Msg("MongoDB Find")
108108
return nil, err
109109
}
110-
defer cur.Close(ctx)
110+
defer cur.Close(ctx) //nolint:errcheck
111111

112112
err = cur.All(ctx, &exams)
113113

db/examgroup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func (db *DB) ExamGroups(ctx context.Context) ([]*model.ExamGroup, error) {
114114
log.Error().Err(err).Str("semester", db.semester).Str("collection", collectionNameExamGroups).Msg("MongoDB Find")
115115
return examGroups, err
116116
}
117-
defer cur.Close(ctx)
117+
defer cur.Close(ctx) //nolint:errcheck
118118

119119
for cur.Next(ctx) {
120120
var examGroup model.ExamGroup

db/external_exam.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func (db *DB) ExternalExams(ctx context.Context) ([]*model.ExternalExam, error)
2727
log.Error().Err(err).Msg("cannot get external exams")
2828
return nil, err
2929
}
30-
defer cur.Close(ctx)
30+
defer cur.Close(ctx) //nolint:errcheck
3131

3232
var result []*model.ExternalExam
3333
err = cur.All(ctx, &result)

db/generatedExams.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func (db *DB) GetGeneratedExams(ctx context.Context) ([]*model.GeneratedExam, er
4040
log.Error().Err(err).Msg("cannot get generated exams")
4141
return nil, err
4242
}
43-
defer cur.Close(ctx)
43+
defer cur.Close(ctx) //nolint:errcheck
4444

4545
exams := make([]*model.GeneratedExam, 0)
4646

@@ -61,7 +61,7 @@ func (db *DB) GetGeneratedExamsForExamer(ctx context.Context, examerID int) ([]*
6161
log.Error().Err(err).Msg("cannot get generated exams")
6262
return nil, err
6363
}
64-
defer cur.Close(ctx)
64+
defer cur.Close(ctx) //nolint:errcheck
6565

6666
exams := make([]*model.GeneratedExam, 0)
6767

db/invigilation.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func (db *DB) invigilationsForInvigilator(ctx context.Context, collectionName st
109109
log.Error().Err(err).Str("collection", collectionSelfInvigilations).Msg("MongoDB Find")
110110
return nil, err
111111
}
112-
defer cur.Close(ctx)
112+
defer cur.Close(ctx) //nolint:errcheck
113113

114114
invigilations := make([]*model.Invigilation, 0)
115115
err = cur.All(ctx, &invigilations)
@@ -144,7 +144,7 @@ func (db *DB) GetSelfInvigilations(ctx context.Context) ([]*model.Invigilation,
144144
log.Error().Err(err).Msg("cannot get invgilations")
145145
return nil, err
146146
}
147-
defer cur.Close(ctx)
147+
defer cur.Close(ctx) //nolint:errcheck
148148

149149
invigilations := make([]*model.Invigilation, 0)
150150
err = cur.All(ctx, &invigilations)
@@ -164,7 +164,7 @@ func (db *DB) GetOtherInvigilations(ctx context.Context) ([]*model.Invigilation,
164164
log.Error().Err(err).Msg("cannot get invgilations")
165165
return nil, err
166166
}
167-
defer cur.Close(ctx)
167+
defer cur.Close(ctx) //nolint:errcheck
168168

169169
invigilations := make([]*model.Invigilation, 0)
170170
err = cur.All(ctx, &invigilations)

db/mucdai.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func (db *DB) MucDaiExamsForProgram(ctx context.Context, program string) ([]*Muc
3131
log.Error().Err(err).Str("program", program).Msg("cannot get exams for MUC.DAI program")
3232
return nil, err
3333
}
34-
defer cur.Close(ctx)
34+
defer cur.Close(ctx) //nolint:errcheck
3535

3636
exams := make([]*MucDaiExam, 0)
3737
err = cur.All(ctx, &exams)

0 commit comments

Comments
 (0)