mirror of
https://github.com/tailscale/tailscale.git
synced 2025-04-18 20:51:45 +00:00
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>
This commit is contained in:
parent
60e768fd14
commit
152390e80a
@ -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…
x
Reference in New Issue
Block a user