diff --git a/chart_parser.go b/chart_parser.go index 92fe515..06b7d0f 100644 --- a/chart_parser.go +++ b/chart_parser.go @@ -5,6 +5,7 @@ import ( "github.com/zieckey/goini" "os" "path/filepath" + "log" ) const DataPrefix = "Data|" @@ -50,6 +51,7 @@ func LookupChartFiles(dir string) ([]string, error) { if ok, err := filepath.Match("*.chart", f.Name()); err != nil { return err } else if ok { + log.Printf("Add chart file %v", path) files = append(files, path) } return nil diff --git a/chart_parser_spline.go b/chart_parser_spline.go index 9b2ecb4..d80eff6 100644 --- a/chart_parser_spline.go +++ b/chart_parser_spline.go @@ -26,9 +26,10 @@ func (c *SplineChart) Parse(ini *goini.INI) (map[string]string, error) { continue } - dd := strings.Split(v, ", ") + dd := strings.Split(v, ",") jd := make([]interface{}, 0) for _, d := range dd { + d = strings.TrimSpace(d) val, err := strconv.ParseFloat(d, 64) if err == nil { jd = append(jd, val) diff --git a/glide.yaml b/glide.yaml new file mode 100644 index 0000000..4bf2404 --- /dev/null +++ b/glide.yaml @@ -0,0 +1,4 @@ +package: github.com/zieckey/gochart +import: +- package: github.com/bitly/go-simplejson +- package: github.com/zieckey/goini