| 95 | } |
| 96 | |
| 97 | func (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 | |
| 115 | func buildRedactorFuncSlice(valueOf reflect.Value, function func(interface{}) RedactorFunc) RedactorSlice { |
| 116 | length := valueOf.Len() |