Skip to content

Commit

Permalink
Codeclimate (#54)
Browse files Browse the repository at this point in the history
* Remove untested check

* Remove New() call

* Ingore more files for codeclimate
  • Loading branch information
hanzei authored Jan 28, 2018
1 parent 84b0369 commit cfebd64
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
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

0 comments on commit cfebd64

Please sign in to comment.