diff options
| author | Sandro Jäckel <sandro.jaeckel@sap.com> | 2022-10-26 11:31:22 +0200 |
|---|---|---|
| committer | Sandro Jäckel <sandro.jaeckel@sap.com> | 2022-10-26 14:05:42 +0200 |
| commit | 04ce17415f25dbf10eba954212c8428ae630df88 (patch) | |
| tree | 1aca7ceab052f17a44bb903fb5a8bd45202bd54c /download.go | |
| parent | fd6e57b6239655722884a49a86be0f051cc32bde (diff) | |
| download | go-schwift-04ce17415f25dbf10eba954212c8428ae630df88.tar.gz | |
Format with go 1.19
Diffstat (limited to 'download.go')
| -rw-r--r-- | download.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/download.go b/download.go index dfd9a07..130df91 100644 --- a/download.go +++ b/download.go @@ -23,9 +23,9 @@ import ( "io/ioutil" ) -//DownloadedObject is returned by Object.Download(). It wraps the io.ReadCloser -//from http.Response.Body with convenience methods for collecting the contents -//into a byte slice or string. +// DownloadedObject is returned by Object.Download(). It wraps the io.ReadCloser +// from http.Response.Body with convenience methods for collecting the contents +// into a byte slice or string. // // var obj *swift.Object // @@ -38,9 +38,9 @@ import ( // //Do this instead: // str, err := obj.Download(nil).AsString() // -//Since all methods on DownloadedObject are irreversible, the idiomatic way of -//using DownloadedObject is to call one of its members immediately, without -//storing the DownloadedObject instance in a variable first. +// Since all methods on DownloadedObject are irreversible, the idiomatic way of +// using DownloadedObject is to call one of its members immediately, without +// storing the DownloadedObject instance in a variable first. // // var obj *swift.Object // @@ -55,13 +55,13 @@ type DownloadedObject struct { err error } -//AsReadCloser returns an io.ReadCloser containing the contents of the -//downloaded object. +// AsReadCloser returns an io.ReadCloser containing the contents of the +// downloaded object. func (o DownloadedObject) AsReadCloser() (io.ReadCloser, error) { return o.r, o.err } -//AsByteSlice collects the contents of this downloaded object into a byte slice. +// AsByteSlice collects the contents of this downloaded object into a byte slice. func (o DownloadedObject) AsByteSlice() ([]byte, error) { if o.err != nil { return nil, o.err @@ -74,7 +74,7 @@ func (o DownloadedObject) AsByteSlice() ([]byte, error) { return slice, closeErr } -//AsString collects the contents of this downloaded object into a string. +// AsString collects the contents of this downloaded object into a string. func (o DownloadedObject) AsString() (string, error) { slice, err := o.AsByteSlice() return string(slice), err |
