Skip to content

Commit

Permalink
minor updates to follow go conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
ddymko committed Jul 12, 2019
1 parent 2281fcc commit efc7756
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions jsonError.go → json_error.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package jsonError
package jsonerror

import (
"encoding/json"
)

// An ErrorJSON contains an array of Errors.
// ErrorJSON contains an array of Errors.
type ErrorJSON struct {
Errors []ErrorComp
}

// An ErrorComp is a error structure that follows the json spec.
// ErrorComp is a error structure that follows the json spec.
type ErrorComp struct {
ID string `json:"id,omitempty"`
Status int `json:"status,omitempty"`
Expand All @@ -19,12 +19,12 @@ type ErrorComp struct {
Source Source `json:"source,omitempty"`
}

// A Source is represents
// Source is represents
type Source struct {
Pointer string `json:"pointer,omitempty"`
}

// Returns the error in string format
// Error returns the error in string format
func (e *ErrorJSON) Error() string {
out, _ := json.Marshal(e)
return string(out)
Expand Down
2 changes: 1 addition & 1 deletion jsonError_test.go → json_error_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package jsonError
package jsonerror

import (
"reflect"
Expand Down

0 comments on commit efc7756

Please sign in to comment.