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 {
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,