@@ -23,10 +23,10 @@ import (
2323 "github.com/sirupsen/logrus"
2424)
2525
26- // HideProgress is used only for testing
26+ // HideProgress is used only for testing.
2727var HideProgress bool
2828
29- // hideBar is used only for testing
29+ // hideBar is used only for testing.
3030func hideBar (bar * pb.ProgressBar ) {
3131 bar .Set (pb .ReturnSymbol , "" )
3232 bar .SetTemplateString ("" )
@@ -96,8 +96,8 @@ func WithDecompress(decompress bool) Opt {
9696// WithExpectedDigest is used to validate the downloaded file against the expected digest.
9797//
9898// The digest is not verified in the following cases:
99- // - The digest was not specified.
100- // - The file already exists in the local target path.
99+ // - The digest was not specified.
100+ // - The file already exists in the local target path.
101101//
102102// When the `data` file exists in the cache dir with `<ALGO>.digest` file,
103103// the digest is verified by comparing the content of `<ALGO>.digest` with the expected
@@ -291,14 +291,14 @@ func Cached(remote string, opts ...Opt) (*Result, error) {
291291}
292292
293293// cacheDirectoryPath returns the cache subdirectory path.
294- // - "url" file contains the url
295- // - "data" file contains the data
294+ // - "url" file contains the url
295+ // - "data" file contains the data
296296func cacheDirectoryPath (cacheDir , remote string ) string {
297297 return filepath .Join (cacheDir , "download" , "by-url-sha256" , fmt .Sprintf ("%x" , sha256 .Sum256 ([]byte (remote ))))
298298}
299299
300300// cacheDigestPath returns the cache digest file path.
301- // - "<ALGO>.digest" contains the digest
301+ // - "<ALGO>.digest" contains the digest
302302func cacheDigestPath (shad string , expectedDigest digest.Digest ) (string , error ) {
303303 shadDigest := ""
304304 if expectedDigest != "" {
@@ -316,9 +316,9 @@ func IsLocal(s string) bool {
316316}
317317
318318// canonicalLocalPath canonicalizes the local path string.
319- // - Make sure the file has no scheme, or the `file://` scheme
320- // - If it has the `file://` scheme, strip the scheme and make sure the filename is absolute
321- // - Expand a leading `~`, or convert relative to absolute name
319+ // - Make sure the file has no scheme, or the `file://` scheme
320+ // - If it has the `file://` scheme, strip the scheme and make sure the filename is absolute
321+ // - Expand a leading `~`, or convert relative to absolute name
322322func canonicalLocalPath (s string ) (string , error ) {
323323 if s == "" {
324324 return "" , fmt .Errorf ("got empty path" )
0 commit comments