aboutsummaryrefslogtreecommitdiff
path: root/http_server_test.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2024-04-06 01:53:49 +0700
committerShulhan <ms@kilabit.info>2024-04-06 01:53:49 +0700
commit490dcc6ec98d065a7b1a81016adae13e11454984 (patch)
tree8035d753ef4420f3c6d8a4b460257af55854226b /http_server_test.go
parentf123985b0a028ecdfd08010cd9d38a95388e2c12 (diff)
downloadawwan-490dcc6ec98d065a7b1a81016adae13e11454984.tar.xz
all: comply with linter recommendations
Diffstat (limited to 'http_server_test.go')
-rw-r--r--http_server_test.go16
1 files changed, 7 insertions, 9 deletions
diff --git a/http_server_test.go b/http_server_test.go
index 331ffe2..2dcd94f 100644
--- a/http_server_test.go
+++ b/http_server_test.go
@@ -27,7 +27,6 @@ func TestHttpServer_Decrypt(t *testing.T) {
type testCase struct {
desc string
expResp string
- expErr string
reqBody []byte
}
@@ -106,7 +105,7 @@ func TestHttpServer_Decrypt(t *testing.T) {
resp, _ = io.ReadAll(httpRes.Body)
gotResp.Reset()
- json.Indent(&gotResp, resp, ``, ` `)
+ _ = json.Indent(&gotResp, resp, ``, ` `)
test.Assert(t, c.desc, c.expResp, gotResp.String())
}
}
@@ -115,7 +114,6 @@ func TestHttpServer_Encrypt(t *testing.T) {
type testCase struct {
desc string
expResp string
- expErr string
reqBody []byte
}
@@ -194,7 +192,7 @@ func TestHttpServer_Encrypt(t *testing.T) {
resp, _ = io.ReadAll(httpRes.Body)
gotResp.Reset()
- json.Indent(&gotResp, resp, ``, ` `)
+ _ = json.Indent(&gotResp, resp, ``, ` `)
test.Assert(t, c.desc, c.expResp, gotResp.String())
}
}
@@ -238,7 +236,7 @@ func TestHttpServer_Execute(t *testing.T) {
var (
clientOpts = libhttp.ClientOptions{
- ServerURL: fmt.Sprintf(`http://%s`, address),
+ ServerURL: `http://` + address,
}
reqJSON = tdata.Input[`local:/local.aww:1-`]
@@ -268,7 +266,7 @@ func TestHttpServer_Execute(t *testing.T) {
var buf bytes.Buffer
- json.Indent(&buf, clientResp.Body, ``, ` `)
+ _ = json.Indent(&buf, clientResp.Body, ``, ` `)
var expResp = string(tdata.Output[`local:/local.aww:1-`])
@@ -369,7 +367,7 @@ func TestHttpServer_ExecuteCancel(t *testing.T) {
var (
clientOpts = libhttp.ClientOptions{
- ServerURL: fmt.Sprintf(`http://%s`, address),
+ ServerURL: `http://` + address,
}
reqJSON = tdata.Input[`local:/cancel.aww:1-`]
@@ -399,7 +397,7 @@ func TestHttpServer_ExecuteCancel(t *testing.T) {
var buf bytes.Buffer
- json.Indent(&buf, clientResp.Body, ``, ` `)
+ _ = json.Indent(&buf, clientResp.Body, ``, ` `)
var expResp = string(tdata.Output[`local:/cancel.aww:1-`])
@@ -552,7 +550,7 @@ func TestHttpServer_FSGet(t *testing.T) {
body, _ = io.ReadAll(httpRes.Body)
jsonBody.Reset()
- json.Indent(&jsonBody, body, ``, ` `)
+ _ = json.Indent(&jsonBody, body, ``, ` `)
test.Assert(t, c.desc, c.exp, jsonBody.String())
}
}