mirror of
https://github.com/TECHNOFAB11/zfs-localpv.git
synced 2025-12-12 14:30:12 +01:00
feat(zfspv) Add golint check to travis (#175)
Signed-off-by: vaniisgh <vanisingh@live.co.uk>
This commit is contained in:
parent
8b7ad5cb45
commit
8bbf3d7d2f
34 changed files with 321 additions and 266 deletions
|
|
@ -20,10 +20,11 @@ import (
|
|||
"strings"
|
||||
)
|
||||
|
||||
// Coerce the map's keys to lower case, which only works when unicode char is in
|
||||
// ASCII subset. May overwrite key-value pairs on different permutations of key
|
||||
// case as in Key and key. DON'T force values to the lower case unconditionally,
|
||||
// because values for keys such as mountpoint or keylocation are case-sensitive.
|
||||
// GetCaseInsensitiveMap coercs the map's keys to lower case, which only works
|
||||
// when unicode char is in ASCII subset. May overwrite key-value pairs on
|
||||
// different permutations of key case as in Key and key. DON'T force values to the
|
||||
// lower case unconditionally, because values for keys such as mountpoint or
|
||||
// keylocation are case-sensitive.
|
||||
// Note that although keys such as 'comPREssion' are accepted and processed,
|
||||
// even if they are technically invalid, updates to rectify such typing will be
|
||||
// prohibited as a forbidden update.
|
||||
|
|
@ -36,7 +37,8 @@ func GetCaseInsensitiveMap(dict *map[string]string) map[string]string {
|
|||
return insensitiveDict
|
||||
}
|
||||
|
||||
// special case of GetCaseInsensitiveMap looking up one key-value pair only
|
||||
// GetInsensitiveParameter handles special case ofGetCaseInsensitiveMap looking up one
|
||||
// key-value pair only
|
||||
func GetInsensitiveParameter(dict *map[string]string, key string) string {
|
||||
insensitiveDict := GetCaseInsensitiveMap(dict)
|
||||
return insensitiveDict[strings.ToLower(key)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue