Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix function comments based on best practices from Effective Go #75

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions simplejson.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"log"
)

// returns the current implementation version
// Version returns the current implementation version
func Version() string {
return "0.5.0"
}
Expand Down Expand Up @@ -48,7 +48,7 @@ func (j *Json) EncodePretty() ([]byte, error) {
return json.MarshalIndent(&j.data, "", " ")
}

// Implements the json.Marshaler interface.
// MarshalJSON: Implements the json.Marshaler interface.
func (j *Json) MarshalJSON() ([]byte, error) {
return json.Marshal(&j.data)
}
Expand Down
2 changes: 1 addition & 1 deletion simplejson_go10.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func NewFromReader(r io.Reader) (*Json, error) {
return j, err
}

// Implements the json.Unmarshaler interface.
// UnmarshalJSON: Implements the json.Unmarshaler interface.
func (j *Json) UnmarshalJSON(p []byte) error {
return json.Unmarshal(p, &j.data)
}
Expand Down
2 changes: 1 addition & 1 deletion simplejson_go11.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"strconv"
)

// Implements the json.Unmarshaler interface.
// UnmarshalJSON: Implements the json.Unmarshaler interface.
func (j *Json) UnmarshalJSON(p []byte) error {
dec := json.NewDecoder(bytes.NewBuffer(p))
dec.UseNumber()
Expand Down