MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / GetRedactionString

Method GetRedactionString

base/redactor.go:97–113  ·  view source on GitHub ↗
(shouldRedact bool)

Source from the content-addressed store, hash-verified

95}
96
97func (redactorSet RedactorSet) GetRedactionString(shouldRedact bool) string {
98 tmp := []byte("{")
99 iterationCount := 0
100 for setItem, _ := range redactorSet.set {
101 if shouldRedact {
102 tmp = append(tmp, redactorSet.redactorFunc(setItem).Redact()...)
103 } else {
104 tmp = append(tmp, redactorSet.redactorFunc(setItem).String()...)
105 }
106 iterationCount++
107 if iterationCount != len(redactorSet.set) {
108 tmp = append(tmp, ", "...)
109 }
110 }
111
112 return string(append(tmp, "}"...))
113}
114
115func buildRedactorFuncSlice(valueOf reflect.Value, function func(interface{}) RedactorFunc) RedactorSlice {
116 length := valueOf.Len()

Callers 2

RedactMethod · 0.95
StringMethod · 0.95

Calls 2

RedactMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected