nt: fix unused write warnings

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino 2024-07-03 20:42:51 +02:00
parent 54bc3ea87d
commit 58de410850
No known key found for this signature in database
GPG key ID: 935D2952DEC4EECF
4 changed files with 3 additions and 8 deletions

View file

@ -448,8 +448,6 @@ func TestDefenderDelay(t *testing.T) {
}, },
}, },
}, },
banned: make(map[string]time.Time),
hosts: make(map[string]hostScore),
} }
startTime := time.Now() startTime := time.Now()
d.DelayLogin(nil) d.DelayLogin(nil)

View file

@ -885,7 +885,6 @@ func TestTransferErrors(t *testing.T) {
fs := newMockOsFs(nil, nil, false, connID, user.GetHomeDir()) fs := newMockOsFs(nil, nil, false, connID, user.GetHomeDir())
connection := &Connection{ connection := &Connection{
BaseConnection: common.NewBaseConnection(connID, common.ProtocolFTP, "", "", user), BaseConnection: common.NewBaseConnection(connID, common.ProtocolFTP, "", "", user),
clientContext: mockCC,
} }
baseTransfer := common.NewBaseTransfer(file, connection.BaseConnection, nil, file.Name(), file.Name(), testfile, baseTransfer := common.NewBaseTransfer(file, connection.BaseConnection, nil, file.Name(), file.Name(), testfile,
common.TransferDownload, 0, 0, 0, 0, false, fs, dataprovider.TransferQuota{}) common.TransferDownload, 0, 0, 0, 0, false, fs, dataprovider.TransferQuota{})

View file

@ -12536,8 +12536,7 @@ func TestStartQuotaScanNonExistentFolderMock(t *testing.T) {
token, err := getJWTAPITokenFromTestServer(defaultTokenAuthUser, defaultTokenAuthPass) token, err := getJWTAPITokenFromTestServer(defaultTokenAuthUser, defaultTokenAuthPass)
assert.NoError(t, err) assert.NoError(t, err)
folder := vfs.BaseVirtualFolder{ folder := vfs.BaseVirtualFolder{
MappedPath: os.TempDir(), Name: "afolder",
Name: "afolder",
} }
req, _ := http.NewRequest(http.MethodPost, path.Join(quotasBasePath, "folders", folder.Name, "scan"), nil) req, _ := http.NewRequest(http.MethodPost, path.Join(quotasBasePath, "folders", folder.Name, "scan"), nil)
setBearerForReq(req, token) setBearerForReq(req, token)
@ -23356,7 +23355,6 @@ func TestWebEventAction(t *testing.T) {
csrfToken, err := getCSRFTokenFromInternalPageMock(webAdminEventActionPath, webToken) csrfToken, err := getCSRFTokenFromInternalPageMock(webAdminEventActionPath, webToken)
assert.NoError(t, err) assert.NoError(t, err)
action := dataprovider.BaseEventAction{ action := dataprovider.BaseEventAction{
ID: 81,
Name: "web_action_http", Name: "web_action_http",
Description: "http web action", Description: "http web action",
Type: dataprovider.ActionTypeHTTP, Type: dataprovider.ActionTypeHTTP,
@ -24289,7 +24287,8 @@ func TestWebIPListEntries(t *testing.T) {
form.Set("protocols", "a") form.Set("protocols", "a")
form.Add("protocols", "1") form.Add("protocols", "1")
form.Add("protocols", "4") form.Add("protocols", "4")
req, err = http.NewRequest(http.MethodPost, webIPListPath+"/2", bytes.NewBuffer([]byte(form.Encode()))) req, err = http.NewRequest(http.MethodPost, webIPListPath+"/"+strconv.Itoa(int(entry.Type)),
bytes.NewBuffer([]byte(form.Encode())))
assert.NoError(t, err) assert.NoError(t, err)
req.Header.Set("Content-Type", "application/x-www-form-urlencoded") req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
setJWTCookieForReq(req, webToken) setJWTCookieForReq(req, webToken)

View file

@ -2769,7 +2769,6 @@ func TestHTTPDFile(t *testing.T) {
user.Permissions["/"] = []string{dataprovider.PermAny} user.Permissions["/"] = []string{dataprovider.PermAny}
connection := &Connection{ connection := &Connection{
BaseConnection: common.NewBaseConnection(xid.New().String(), common.ProtocolHTTP, "", "", user), BaseConnection: common.NewBaseConnection(xid.New().String(), common.ProtocolHTTP, "", "", user),
request: nil,
} }
fs, err := user.GetFilesystem("") fs, err := user.GetFilesystem("")