Skip to content

Commit db8773b

Browse files
committed
Fix ineffectual assignments
1 parent 6a458a2 commit db8773b

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

mega.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,6 @@ func (m *Mega) api_request(r []byte) (buf []byte, err error) {
492492

493493
if resp.StatusCode != 200 {
494494
// err must be not-nil on a continue
495-
err = errors.New("Http Status: " + resp.Status)
496495
_ = resp.Body.Close()
497496
continue
498497
}
@@ -1500,7 +1499,6 @@ func (u *Upload) UploadChunk(id int, chunk []byte) (err error) {
15001499
ctr_aes.XORKeyStream(chunk, chunk)
15011500
chk_url := fmt.Sprintf("%s/%d", u.uploadUrl, chk_start)
15021501

1503-
chunk_resp := []byte{}
15041502
sleepTime := minSleepTime // inital backoff time
15051503
for retry := 0; retry < u.m.retries+1; retry++ {
15061504
reader := bytes.NewBuffer(chunk)
@@ -1526,7 +1524,7 @@ func (u *Upload) UploadChunk(id int, chunk []byte) (err error) {
15261524
return errors.New("retries exceeded")
15271525
}
15281526

1529-
chunk_resp, err = ioutil.ReadAll(rsp.Body)
1527+
chunk_resp, err := ioutil.ReadAll(rsp.Body)
15301528
if err != nil {
15311529
_ = rsp.Body.Close()
15321530
return err

utils.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,6 @@ func getChunkSizes(size int64) (chunks []chunkSize) {
309309
var attrMatch = regexp.MustCompile(`{".*"}`)
310310

311311
func decryptAttr(key []byte, data string) (attr FileAttr, err error) {
312-
err = EBADATTR
313312
block, err := aes.NewCipher(key)
314313
if err != nil {
315314
return attr, err
@@ -338,7 +337,6 @@ func decryptAttr(key []byte, data string) (attr FileAttr, err error) {
338337
}
339338

340339
func encryptAttr(key []byte, attr FileAttr) (b string, err error) {
341-
err = EBADATTR
342340
block, err := aes.NewCipher(key)
343341
if err != nil {
344342
return "", err

0 commit comments

Comments
 (0)