diff --git a/core/bean/doc.go b/core/bean/doc.go index f806a081..049fe563 100644 --- a/core/bean/doc.go +++ b/core/bean/doc.go @@ -12,6 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// bean is a basic package +// Package bean is a basic package // it should not depend on other modules except common module, log module and config module package bean diff --git a/core/berror/error.go b/core/berror/error.go index ca09798a..c40009c6 100644 --- a/core/berror/error.go +++ b/core/berror/error.go @@ -25,7 +25,7 @@ import ( // code, msg const errFmt = "ERROR-%d, %s" -// Err returns an error representing c and msg. If c is OK, returns nil. +// Error returns an error representing c and msg. If c is OK, returns nil. func Error(c Code, msg string) error { return fmt.Errorf(errFmt, c.Code(), msg) } diff --git a/core/config/config.go b/core/config/config.go index 95a4eb26..9e84f059 100644 --- a/core/config/config.go +++ b/core/config/config.go @@ -53,20 +53,20 @@ import ( // Configer defines how to get and set value from configuration raw data. type Configer interface { - // support section::key type in given key when using ini type. + // Set support section::key type in given key when using ini type. Set(key, val string) error - // support section::key type in key string when using ini and json type; Int,Int64,Bool,Float,DIY are same. + // String support section::key type in key string when using ini and json type; Int,Int64,Bool,Float,DIY are same. String(key string) (string, error) - // get string slice + // Strings get string slice Strings(key string) ([]string, error) Int(key string) (int, error) Int64(key string) (int64, error) Bool(key string) (bool, error) Float(key string) (float64, error) - // support section::key type in key string when using ini and json type; Int,Int64,Bool,Float,DIY are same. + // DefaultString support section::key type in key string when using ini and json type; Int,Int64,Bool,Float,DIY are same. DefaultString(key string, defaultVal string) string - // get string slice + // DefaultStrings get string slice DefaultStrings(key string, defaultVal []string) []string DefaultInt(key string, defaultVal int) int DefaultInt64(key string, defaultVal int64) int64 diff --git a/core/config/toml/toml.go b/core/config/toml/toml.go index 0c678164..d278e8dc 100644 --- a/core/config/toml/toml.go +++ b/core/config/toml/toml.go @@ -19,8 +19,6 @@ import ( "os" "strings" - "github.com/pelletier/go-toml" - "github.com/beego/beego/v2/core/config" ) @@ -135,7 +133,7 @@ func (c *configContainer) Int64(key string) (int64, error) { } } -// bool return bool value +// Bool return bool value // return error if key not found or value is invalid type func (c *configContainer) Bool(key string) (bool, error) { res, err := c.get(key) diff --git a/core/utils/time.go b/core/utils/time.go index 00d13861..2f813a05 100644 --- a/core/utils/time.go +++ b/core/utils/time.go @@ -19,7 +19,7 @@ import ( "time" ) -// short string format +// ToShortTimeFormat short string format func ToShortTimeFormat(d time.Duration) string { u := uint64(d) if u < uint64(time.Second) {