master > master: codego - utils + unit tests, A1[0-9]+ mit testen
This commit is contained in:
@@ -85,6 +85,14 @@ func SumList(x []int) int {
|
||||
* METHODS: for string lists
|
||||
* ---------------------------------------------------------------- */
|
||||
|
||||
func CopyStringList(list []string) []string {
|
||||
var listCopy = make([]string, len(list))
|
||||
for i, value := range list {
|
||||
listCopy[i] = value
|
||||
}
|
||||
return listCopy
|
||||
}
|
||||
|
||||
func StrListContains(list []string, x string) bool {
|
||||
for _, obj := range list {
|
||||
if obj == x {
|
||||
@@ -153,3 +161,15 @@ func UnionStringsList(lists [][]string) []string {
|
||||
}
|
||||
return list
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------- *
|
||||
* METHODS: for maps
|
||||
* ---------------------------------------------------------------- */
|
||||
|
||||
func CopyMapStringBool(m map[string]bool) map[string]bool {
|
||||
var mCopy = map[string]bool{}
|
||||
for key, value := range m {
|
||||
mCopy[key] = value
|
||||
}
|
||||
return mCopy
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user