dati

A Go library/binary to parse & execute data against template langauges.
git clone git://src.gearsix.net/dati
Log | Files | Refs | Atom | README | LICENSE

commit 606a9b864c321d22c35580287e6f4b7c803b12bd
parent 48f4adca68d4d7713ae0586c39b3c7af7864ca7a
Author: gearsix <gearsix@tuta.io>
Date:   Tue, 27 Apr 2021 17:29:35 +0100

moretidyup

Diffstat:
Mcmd/suti.go | 3+--
Mdata.go | 2+-
Mfile_test.go | 2+-
3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/cmd/suti.go b/cmd/suti.go @@ -21,7 +21,6 @@ import ( "bufio" "bytes" "fmt" - "io" "io/fs" "notabug.org/gearsix/suti" "os" @@ -29,6 +28,7 @@ import ( "strings" ) +// Data is just a generic map for key/value data type Data map[string]interface{} type options struct { @@ -227,7 +227,6 @@ func parseConfig(fpath string, existing options) options { var cfgf *os.File if cfgf, err = os.Open(fpath); err != nil { warn(err, "error loading config file '%s'", fpath) - err = io.EOF } defer cfgf.Close() diff --git a/data.go b/data.go @@ -61,7 +61,7 @@ func LoadDataFile(path string, outp interface{}) error { if e == nil { lang := filepath.Ext(path)[1:] // don't include '.' if e = LoadData(lang, f, outp); e != nil { - e = fmt.Errorf("failed to load data '%s':", e.Error()) + e = fmt.Errorf("failed to load data '%s': %s", e.Error()) } } diff --git a/file_test.go b/file_test.go @@ -12,7 +12,7 @@ func TestSortFileList(t *testing.T) { var err error tdir := t.TempDir() paths := []string{tdir + "/1", tdir + "/3", tdir + "/2"} - sorted := make([]string, 0, len(paths)) + var sorted []string sorted, err = SortFileList(paths, "filename") if err != nil {