MCPcopy Index your code
hub / github.com/weaveworks/scope / MakeStringSet

Function MakeStringSet

report/string_set.go:14–29  ·  view source on GitHub ↗

MakeStringSet makes a new StringSet with the given strings.

(strs ...string)

Source from the content-addressed store, hash-verified

12
13// MakeStringSet makes a new StringSet with the given strings.
14func MakeStringSet(strs ...string) StringSet {
15 if len(strs) <= 0 {
16 return nil
17 }
18 result := make([]string, len(strs))
19 copy(result, strs)
20 sort.Strings(result)
21 for i := 1; i < len(result); { // shuffle down any duplicates
22 if result[i-1] == result[i] {
23 result = append(result[:i-1], result[i:]...)
24 continue
25 }
26 i++
27 }
28 return StringSet(result)
29}
30
31// Contains returns true if the string set includes the given string
32func (s StringSet) Contains(str string) bool {

Callers 15

report_fixture.goFile · 0.92
TestReportLocalNetworksFunction · 0.92
TestNodeMetadataFunction · 0.92
TestNodeTablesFunction · 0.92
TestParentsFunction · 0.92
getNodeFunction · 0.92
ReportMethod · 0.92
TestTaggerFunction · 0.92
TestTaggerFunction · 0.92
addDNSMethod · 0.92
checkControlsFunction · 0.92

Calls 1

StringSetTypeAlias · 0.85

Tested by 15

TestReportLocalNetworksFunction · 0.74
TestNodeMetadataFunction · 0.74
TestNodeTablesFunction · 0.74
TestParentsFunction · 0.74
TestTaggerFunction · 0.74
TestTaggerFunction · 0.74
checkControlsFunction · 0.74
TestContainerFunction · 0.74
GetNodeMethod · 0.74
TestOverlayTopologyFunction · 0.74
TestReportUpgradeFunction · 0.74
TestSetsAddFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…