From 84bc4dc142424ad0bc9f9896939e5a7c09078a5c Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sun, 21 Jan 2018 09:51:28 +0000 Subject: [PATCH] Clarify RangeOption semantics --- fs/options.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/fs/options.go b/fs/options.go index 0e3fa9a07..c8fec17e4 100644 --- a/fs/options.go +++ b/fs/options.go @@ -23,6 +23,15 @@ type OpenOption interface { // RangeOption defines an HTTP Range option with start and end. If // either start or end are < 0 then they will be omitted. +// +// End may be bigger than the Size of the object in which case it will +// be capped to the size of the object. +// +// Note that the End is inclusive, so to fetch 100 bytes you would use +// RangeOption{Start: 0, End: 99} +// +// A RangeOption implements a single byte-range-spec from +// https://tools.ietf.org/html/rfc7233#section-2.1 type RangeOption struct { Start int64 End int64