ipn/localapi: avoid unkeyed literal (#9933)

Go has no way to explicitly identify Go struct as effectively a tuple,
so staticcheck assumes any external use of unkeyed literals is wrong.

Updates #cleanup

Signed-off-by: Joe Tsai <joetsai@digital-static.net>
pull/9929/head
Joe Tsai 1 year ago committed by GitHub
parent 60e768fd14
commit 152390e80a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1360,7 +1360,7 @@ func (h *Handler) serveFilePut(w http.ResponseWriter, r *http.Request) {
outReq.ContentLength = r.ContentLength outReq.ContentLength = r.ContentLength
if offset > 0 { if offset > 0 {
h.logf("resuming put at offset %d after %v", offset, resumeDuration) h.logf("resuming put at offset %d after %v", offset, resumeDuration)
rangeHdr, _ := httphdr.FormatRange([]httphdr.Range{{offset, 0}}) rangeHdr, _ := httphdr.FormatRange([]httphdr.Range{{Start: offset, Length: 0}})
outReq.Header.Set("Range", rangeHdr) outReq.Header.Set("Range", rangeHdr)
if outReq.ContentLength >= 0 { if outReq.ContentLength >= 0 {
outReq.ContentLength -= offset outReq.ContentLength -= offset

Loading…
Cancel
Save