Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,9 @@ exclude_patterns:
- ".github/"
- "vendor/"
- "codegen/"
- "*.yml"
- "*.md"
- "Gopkg.*"
- "doc.go"
- ".gitignore"
- "LICENSE"
5 changes: 1 addition & 4 deletions conversions.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ func (m Map) Base64() (string, error) {
}

encoder := base64.NewEncoder(base64.StdEncoding, &buf)
_, err = encoder.Write([]byte(jsonData))
if err != nil {
return "", err
}
_, _ = encoder.Write([]byte(jsonData))
_ = encoder.Close()

return buf.String(), nil
Expand Down
4 changes: 2 additions & 2 deletions map.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ func MustFromJSON(jsonString string) Map {
//
// Returns an error if the JSON is invalid.
func FromJSON(jsonString string) (Map, error) {
var data interface{}
var data Map
err := json.Unmarshal([]byte(jsonString), &data)
if err != nil {
return Nil, err
}
return New(data), nil
return data, nil
}

// FromBase64 creates a new Obj containing the data specified
Expand Down