func toRange(offset, length int64) string {
	switch {
	case offset == 0 && length < 0:
		return ""
	case length < 0:
		return fmt.Sprintf("bytes=%d-", offset)
	case length == 0:
		// There's no way to read 0 bytes, so we read 1 byte instead.
		return fmt.Sprintf("bytes=%d-%d", offset, offset)
	default:
		return fmt.Sprintf("bytes=%d-%d", offset, offset+length-1)
	}
}
// Returns a valid HTTP Range header value.
Returns a valid HTTP Range header value.
// Returns a valid HTTP Range header value .
func toRange(offset, length int64) string {
	switch {
	case offset == 0 && length < 0:
		return ""
	case length < 0:
		return fmt.Sprintf("bytes=%d-", offset)
	case length == 0:
		return fmt.Sprintf("bytes=%d-%d", offset, offset)
	default:
		return fmt.Sprintf("bytes=%d-%d", offset, offset+length-1)
	}
}
func toRange ( offset , length int64 ) string { switch { case offset == 0 && length < 0 : return " " case length < 0 : return fmt . Sprintf ( " " , offset ) case length == 0 : return fmt . Sprintf ( " " , offset , offset ) default : return fmt . Sprintf ( " " , offset , offset + length - 1 ) } }
Returns a valid HTTP Range header value.
Returns a valid HTTP Range header value .
// There's no way to read 0 bytes, so we read 1 byte instead.