fix golint issues in core/mapping (#497)

This commit is contained in:
Kevin Wan
2021-02-20 23:18:22 +08:00
committed by GitHub
parent 226513ed60
commit 334ee4213f
8 changed files with 87 additions and 67 deletions

View File

@@ -1,13 +1,17 @@
package mapping
type (
// A Valuer interface defines the way to get values from the underlying object with keys.
Valuer interface {
// Value gets the value associated with the given key.
Value(key string) (interface{}, bool)
}
// A MapValuer is a map that can use Value method to get values with given keys.
MapValuer map[string]interface{}
)
// Value gets the value associated with the given key from mv.
func (mv MapValuer) Value(key string) (interface{}, bool) {
v, ok := mv[key]
return v, ok