fixes #8 type and version added to json export

This commit is contained in:
Andreas Schröpfer
2021-03-01 16:36:48 +01:00
parent 040e8c7303
commit 2511a2fcd3
3 changed files with 4 additions and 0 deletions

View File

@@ -28,6 +28,7 @@ func DefaultConf() *Conf {
type Conf struct { type Conf struct {
Title string `json:"title"` Title string `json:"title"`
Version string `json:"version"` Version string `json:"version"`
Type string `json:"type"`
Values []Value `json:"values"` Values []Value `json:"values"`
Areas []Area `json:"areas"` Areas []Area `json:"areas"`
Rating Rating `json:"rating"` Rating Rating `json:"rating"`

View File

@@ -1,6 +1,7 @@
{ {
"title": "Good Balance Calculator", "title": "Good Balance Calculator",
"version": "5.04", "version": "5.04",
"type": "Full",
"values": [ "values": [
{ {
"sheet": 2, "sheet": 2,

View File

@@ -18,6 +18,8 @@ func XLSX(r io.Reader, conf *Conf) (*ecalc.Ecalc, error) {
if conf == nil { if conf == nil {
conf = DefaultConf() conf = DefaultConf()
} }
eBalance.Version = conf.Version
eBalance.Type = conf.Type
xFile, err := excelize.OpenReader(r) xFile, err := excelize.OpenReader(r)
if err != nil { if err != nil {
return nil, fmt.Errorf("XLSX.OpenReader: %w", err) return nil, fmt.Errorf("XLSX.OpenReader: %w", err)