Other: Bump linter

This commit is contained in:
Jakub
2021-04-07 09:19:22 +02:00
parent 2f35c453a1
commit 7d0af7624c
22 changed files with 116 additions and 47 deletions

View File

@ -104,7 +104,7 @@ func writeMultipartReport(w *multipart.Writer, rep *ReportReq) error { // nolint
fmt.Sprintf(`form-data; name="%s"; filename="%s"`,
quoteEscaper.Replace(att.name), quoteEscaper.Replace(att.filename+".zip")))
h.Set("Content-Type", "application/octet-stream")
//h.Set("Content-Transfere-Encoding", "base64")
// h.Set("Content-Transfer-Encoding", "base64")
attWr, err := w.CreatePart(h)
if err != nil {
return err
@ -112,7 +112,7 @@ func writeMultipartReport(w *multipart.Writer, rep *ReportReq) error { // nolint
zipArch := zip.NewWriter(attWr)
zipWr, err := zipArch.Create(att.filename)
//b64 := base64.NewEncoder(base64.StdEncoding, zipWr)
// b64 := base64.NewEncoder(base64.StdEncoding, zipWr)
if err != nil {
return err
}
@ -121,7 +121,7 @@ func writeMultipartReport(w *multipart.Writer, rep *ReportReq) error { // nolint
return err
}
err = zipArch.Close()
//err = b64.Close()
// err = b64.Close()
if err != nil {
return err
}

View File

@ -293,7 +293,7 @@ func (c *client) doBuffered(req *http.Request, bodyBuffer []byte, retryUnauthori
retryAfter = headerAfter
}
// To avoid spikes when all clients retry at the same time, we add some random wait.
retryAfter += rand.Intn(10)
retryAfter += rand.Intn(10) //nolint[gosec] It is OK to use weak random number generator here
if hasBody {
r := bytes.NewReader(bodyBuffer)

View File

@ -60,7 +60,7 @@ type ContactEmail struct {
var errVerificationFailed = errors.New("signature verification failed")
//================= Public utility functions ======================
// ================= Public utility functions ======================
func (c *client) EncryptAndSignCards(cards []Card) ([]Card, error) {
var err error
@ -105,7 +105,7 @@ func (c *client) DecryptAndVerifyCards(cards []Card) ([]Card, error) {
return cards, nil
}
//====================== READ ===========================
// ====================== READ ===========================
type ContactsListRes struct {
Res
@ -235,7 +235,7 @@ func (c *client) GetContactEmailByEmail(email string, page int, pageSize int) (c
return
}
//============================ CREATE ====================================
// ============================ CREATE ====================================
type CardsList struct {
Cards []Card
@ -419,7 +419,7 @@ func (c *client) DeleteAllContacts() (err error) {
return
}
//===================== Private utility methods =======================
// ===================== Private utility methods =======================
func isSignedCardType(cardType int) bool {
return (cardType & CardSigned) == CardSigned

View File

@ -137,7 +137,7 @@ func newMessagePackage(
}
type sendData struct {
decryptedBodyKey *crypto.SessionKey //body session key
decryptedBodyKey *crypto.SessionKey // body session key
addressMap map[string]*MessageAddress
sharedScheme PackageFlag
ciphertext []byte