Use the Afero source fs where relevant

Fixes #2319
This commit is contained in:
Bjørn Erik Pedersen
2016-07-30 15:37:03 +02:00
parent a0859dc672
commit 4ddd5361c1
4 changed files with 13 additions and 34 deletions

View File

@@ -17,7 +17,6 @@ package commands
import (
"fmt"
"io/ioutil"
"net/http"
"os"
"path/filepath"
@@ -971,19 +970,7 @@ func isThemeVsHugoVersionMismatch() (mismatch bool, requiredMinVersion string) {
return
}
f, err := fs.Open(path)
if err != nil {
return
}
defer f.Close()
b, err := ioutil.ReadAll(f)
if err != nil {
return
}
b, err := afero.ReadFile(fs, path)
c, err := parser.HandleTOMLMetaData(b)