Skip to content

Commit

Permalink
Use document.ReadFile to read #+SETUPFILE
Browse files Browse the repository at this point in the history
Now that we allow providing a custom ReadFile implementation we should use it
everywhere we read files.
  • Loading branch information
niklasfasching committed Oct 8, 2019
1 parent 9de6524 commit 2afd115
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions org/keyword.go
Expand Up @@ -2,7 +2,6 @@ package org

import (
"bytes"
"io/ioutil"
"path/filepath"
"regexp"
"strings"
Expand Down Expand Up @@ -143,7 +142,7 @@ func (d *Document) loadSetupFile(k Keyword) (int, Node) {
if !filepath.IsAbs(path) {
path = filepath.Join(filepath.Dir(d.Path), path)
}
bs, err := ioutil.ReadFile(path)
bs, err := d.ReadFile(path)
if err != nil {
d.Log.Printf("Bad setup file: %#v: %s", k, err)
return 1, k
Expand Down

0 comments on commit 2afd115

Please sign in to comment.