diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2018-05-22 12:43:20 -0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-05-22 13:12:05 -0400 |
commit | 9ea397861feeefcce9f18947e10aa6cc155ec459 (patch) | |
tree | c41647a0528d1872135dab9147f8eb0c96d77447 /deno_dir.go | |
parent | cd9c361ee1b09b42e731d79ce55b95a3e9bc4fbc (diff) |
Fix LoadOutputCodeCache
Diffstat (limited to 'deno_dir.go')
-rw-r--r-- | deno_dir.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/deno_dir.go b/deno_dir.go index 185f7abe0..d53bf85d8 100644 --- a/deno_dir.go +++ b/deno_dir.go @@ -61,15 +61,17 @@ func FetchRemoteSource(remoteUrl string, localFilename string) ([]byte, error) { return ioutil.ReadAll(sourceReader) } -func LoadOutputCodeCache(filename string, sourceCodeBuf []byte) (outputCode string, err error) { +func LoadOutputCodeCache(filename string, sourceCodeBuf []byte) ( + outputCode string, err error) { cacheFn := CacheFileName(filename, sourceCodeBuf) outputCodeBuf, err := ioutil.ReadFile(cacheFn) if os.IsNotExist(err) { - err = nil // Ignore error if we can't load the cache. - } else if err != nil { + // Ignore error if we can't find the cache file. + err = nil + } else if err == nil { outputCode = string(outputCodeBuf) } - return + return outputCode, err } func UserHomeDir() string { |