From fdaa513566afaaec63824ddea0c03f439e90f40d Mon Sep 17 00:00:00 2001 From: CodeLingo Bot Date: Wed, 13 Feb 2019 00:58:43 +0000 Subject: [PATCH] Fix function comments based on best practices from Effective Go Signed-off-by: CodeLingo Bot --- simplejson.go | 4 ++-- simplejson_go10.go | 2 +- simplejson_go11.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/simplejson.go b/simplejson.go index 95e73fd..0e9598f 100644 --- a/simplejson.go +++ b/simplejson.go @@ -6,7 +6,7 @@ import ( "log" ) -// returns the current implementation version +// Version returns the current implementation version func Version() string { return "0.5.0" } @@ -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) } diff --git a/simplejson_go10.go b/simplejson_go10.go index c9151e9..05fccd1 100644 --- a/simplejson_go10.go +++ b/simplejson_go10.go @@ -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) } diff --git a/simplejson_go11.go b/simplejson_go11.go index 1c47953..acfa213 100644 --- a/simplejson_go11.go +++ b/simplejson_go11.go @@ -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()