Skip to content

Commit

Permalink
bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
TheFireMike committed Sep 7, 2021
1 parent e423069 commit 6fd429e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion doc/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
package doc

// Version specifies the current version.
const Version = "v0.3.5"
const Version = "v0.4.1"
13 changes: 6 additions & 7 deletions internal/parser/object_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ func ToXML(i interface{}) ([]byte, error) {
if p, ok := i.(xmlParser); ok {
return p.ToXML()
}
responseString, err := xml.Marshal(i)
response, err := xml.Marshal(i)
if err != nil {
return nil, errors.Wrap(err, "failed to marshal to xml")
}
return responseString, nil
return response, nil
}

// ToJSON parses the object to JSON.
Expand All @@ -68,11 +68,11 @@ func ToJSON(i interface{}) ([]byte, error) {
if p, ok := i.(jsonParser); ok {
return p.ToJSON()
}
responseString, err := json.Marshal(i)
response, err := json.Marshal(i)
if err != nil {
return nil, errors.Wrap(err, "failed to marshal to json")
}
return responseString, nil
return response, nil
}

// ToCSV parses the object to CSV.
Expand All @@ -81,12 +81,11 @@ func ToCSV(i interface{}) ([]byte, error) {
if p, ok := i.(csvParser); ok {
return p.ToCSV()
}
var buffer bytes.Buffer
err := gocsv.Marshal(i, &buffer)
response, err := gocsv.MarshalBytes(i)
if err != nil {
return nil, errors.Wrap(err, "failed to marshal to csv")
}
return buffer.Bytes(), nil
return response, nil
}

//ToHumanReadable parses the object to a human readable format.
Expand Down

0 comments on commit 6fd429e

Please sign in to comment.