summaryrefslogtreecommitdiff
path: root/data/datasource_file.go
diff options
context:
space:
mode:
authorDave Henderson <dhenderson@gmail.com>2018-08-21 22:22:00 -0400
committerDave Henderson <dhenderson@gmail.com>2018-08-21 23:06:10 -0400
commit0e79af96f4013d8f1d842b7dac04879a062ed37a (patch)
tree6136c68760649e0ee428903ff83c53f2b2569e22 /data/datasource_file.go
parent4e0bb2579fa6f6d8b04356b170198f1a212ab0ff (diff)
Unexporting things that were never meant to be exported...
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'data/datasource_file.go')
-rw-r--r--data/datasource_file.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/data/datasource_file.go b/data/datasource_file.go
index e66615c0..02c9cc81 100644
--- a/data/datasource_file.go
+++ b/data/datasource_file.go
@@ -15,8 +15,8 @@ import (
)
func readFile(source *Source, args ...string) ([]byte, error) {
- if source.FS == nil {
- source.FS = vfs.OS()
+ if source.fs == nil {
+ source.fs = vfs.OS()
}
p := filepath.FromSlash(source.URL.Path)
@@ -33,20 +33,20 @@ func readFile(source *Source, args ...string) ([]byte, error) {
}
// make sure we can access the file
- i, err := source.FS.Stat(p)
+ i, err := source.fs.Stat(p)
if err != nil {
return nil, errors.Wrapf(err, "Can't stat %s", p)
}
if strings.HasSuffix(p, "/") {
- source.Type = jsonArrayMimetype
+ source.mediaType = jsonArrayMimetype
if i.IsDir() {
return readFileDir(source, p)
}
return nil, errors.Errorf("%s is not a directory", p)
}
- f, err := source.FS.OpenFile(p, os.O_RDONLY, 0)
+ f, err := source.fs.OpenFile(p, os.O_RDONLY, 0)
if err != nil {
return nil, errors.Wrapf(err, "Can't open %s", p)
}
@@ -59,7 +59,7 @@ func readFile(source *Source, args ...string) ([]byte, error) {
}
func readFileDir(source *Source, p string) ([]byte, error) {
- names, err := source.FS.ReadDir(p)
+ names, err := source.fs.ReadDir(p)
if err != nil {
return nil, err
}