Other: add straightforward linters

This commit is contained in:
Jakub
2021-04-08 08:00:39 +02:00
parent 7d0af7624c
commit 2d95f21567
49 changed files with 148 additions and 139 deletions

View File

@ -43,8 +43,8 @@ func newFakeSettings() *fakeSettings {
}
// We should use nonstandard ports to not conflict with bridge.
s.SetInt(settings.IMAPPortKey, 21100+rand.Intn(100)) //noling[gosec] G404 It is OK to use weak random number generator here
s.SetInt(settings.SMTPPortKey, 21200+rand.Intn(100)) //noling[gosec] G404 It is OK to use weak random number generator here
s.SetInt(settings.IMAPPortKey, 21100+rand.Intn(100)) //nolint[gosec] G404 It is OK to use weak random number generator here
s.SetInt(settings.SMTPPortKey, 21200+rand.Intn(100)) //nolint[gosec] G404 It is OK to use weak random number generator here
return s
}

View File

@ -88,7 +88,7 @@ func (ctx *TestContext) GetTransferRemoteIMAPServer() *mocks.IMAPServer {
return ctx.transferRemoteIMAPServer
}
port := 21300 + rand.Intn(100)
port := 21300 + rand.Intn(100) //nolint[gosec] It is OK to use weaker rand generator here
ctx.transferRemoteIMAPServer = mocks.NewIMAPServer("user", "pass", "127.0.0.1", strconv.Itoa(port))
ctx.transferRemoteIMAPServer.Start()

View File

@ -37,7 +37,7 @@ func (ctx *TestContext) GetUsers() *users.Users {
// LoginUser logs in the user with the given username, password, and mailbox password.
func (ctx *TestContext) LoginUser(username, password, mailboxPassword string) (err error) {
srp.RandReader = rand.New(rand.NewSource(42))
srp.RandReader = rand.New(rand.NewSource(42)) //nolint[gosec] It is OK to use weaker random number generator here
client, auth, err := ctx.users.Login(username, password)
if err != nil {
@ -120,7 +120,7 @@ func (ctx *TestContext) eventuallySyncIsFinished(store *store.Store) {
}
// EventuallySyncIsFinishedForUsername will wait until sync is finished or
// deadline is reached see eventuallySyncIsFinished for timing
// deadline is reached see eventuallySyncIsFinished for timing.
func (ctx *TestContext) EventuallySyncIsFinishedForUsername(username string) {
store, err := ctx.GetStore(username)
assert.Nil(ctx.t, err)