header.go
func (h *RequestHeader) SetByteRange(startPos, endPos int) {
	h.parseRawHeaders()

	b := h.bufKV.value[:0]
	b = append(b, strBytes...)
	b = append(b, '=')
	if startPos >= 0 {
		b = AppendUint(b, startPos)
	} else {
		endPos = -startPos
	}
	b = append(b, '-')
	if endPos >= 0 {
		b = AppendUint(b, endPos)
	}
	h.bufKV.value = b

	h.SetCanonical(strRange, h.bufKV.value)
}
func (h *RequestHeader) SetByteRange(startPos, endPos int) {
	h.parseRawHeaders()

	b := h.bufKV.value[:0]
	b = append(b, strBytes...)
	b = append(b, '=')
	if startPos >= 0 {
		b = AppendUint(b, startPos)
	} else {
		endPos = -startPos
	}
	b = append(b, '-')
	if endPos >= 0 {
		b = AppendUint(b, endPos)
	}
	h.bufKV.value = b

	h.SetCanonical(strRange, h.bufKV.value)
}
func ( h * RequestHeader ) SetByteRange ( startPos , endPos int ) { h . parseRawHeaders ( ) b := h . bufKV . value [ : 0 ] b = append ( b , strBytes ... ) b = append ( b , '=' ) if startPos >= 0 { b = AppendUint ( b , startPos ) } else { endPos = - startPos } b = append ( b , '-' ) if endPos >= 0 { b = AppendUint ( b , endPos ) } h . bufKV . value = b h . SetCanonical ( strRange , h . bufKV . value ) }
// SetByteRange sets 'Range: bytes=startPos-endPos' header.
//
//     * If startPos is negative, then 'bytes=-startPos' value is set.
//     * If endPos is negative, then 'bytes=startPos-' value is set.
SetByteRange sets Range : bytes = startPos - endPos header . * If startPos is negative then bytes = - startPos value is set . * If endPos is negative then bytes = startPos - value is set .