MCPcopy Create free account
hub / github.com/baidu/EasyFaaS / StringKeySet

Function StringKeySet

pkg/funclet/runtime/cgroup/string.go:38–46  ·  view source on GitHub ↗

StringKeySet creates a String from a keys of a map[string](? extends interface{}). If the value passed in is not actually a map, this will panic.

(theMap interface{})

Source from the content-addressed store, hash-verified

36// StringKeySet creates a String from a keys of a map[string](? extends interface{}).
37// If the value passed in is not actually a map, this will panic.
38func StringKeySet(theMap interface{}) String {
39 v := reflect.ValueOf(theMap)
40 ret := String{}
41
42 for _, keyValue := range v.MapKeys() {
43 ret.Insert(keyValue.Interface().(string))
44 }
45 return ret
46}
47
48// Insert adds items to the set.
49func (s String) Insert(items ...string) {

Callers

nothing calls this directly

Calls 1

InsertMethod · 0.95

Tested by

no test coverage detected