add configuration updating feature for package gcfg

This commit is contained in:
john
2020-07-15 00:07:07 +08:00
parent d29b0a27ff
commit 64c99b9871
5 changed files with 119 additions and 8 deletions

View File

@ -150,13 +150,13 @@ func (j *Json) GetString(pattern string, def ...interface{}) string {
return gconv.String(j.Get(pattern, def...))
}
// GetBytes retrieves the value by specified <pattern> and converts it to byte.
// GetBytes retrieves the value by specified <pattern> and converts it to []byte.
func (j *Json) GetBytes(pattern string, def ...interface{}) []byte {
return gconv.Bytes(j.Get(pattern, def...))
}
// GetBool gets the value by specified <pattern>,
// and converts it to bool.
// GetBool retrieves the value by specified <pattern>,
// converts and returns it as bool.
// It returns false when value is: "", 0, false, off, nil;
// or returns true instead.
func (j *Json) GetBool(pattern string, def ...interface{}) bool {