]> git.r.bdr.sh - rbdr/mobius/blobdiff - hotline/file_transfer.go
Clean up various linter warnings
[rbdr/mobius] / hotline / file_transfer.go
index ba4a1e1b3f12a621a6c8067bee4d61ca4e56e52c..194e8b9890e862ac0401e1e758ba3f37b3fc595b 100644 (file)
@@ -1,21 +1,21 @@
 package hotline
 
 import (
+       "crypto/rand"
        "encoding/binary"
        "fmt"
        "math"
-       "math/rand"
        "path/filepath"
        "sync"
 )
 
 // File transfer types
 const (
-       FileDownload   = 0
-       FileUpload     = 1
-       FolderDownload = 2
-       FolderUpload   = 3
-       bannerDownload = 4
+       FileDownload = iota
+       FileUpload
+       FolderDownload
+       FolderUpload
+       bannerDownload
 )
 
 type FileTransfer struct {
@@ -51,7 +51,7 @@ func (wc *WriteCounter) Write(p []byte) (int, error) {
 
 func (cc *ClientConn) newFileTransfer(transferType int, fileName, filePath, size []byte) *FileTransfer {
        var transactionRef [4]byte
-       rand.Read(transactionRef[:])
+       _, _ = rand.Read(transactionRef[:])
 
        ft := &FileTransfer{
                FileName:         fileName,