WithBoolean helps an option setter (WithXXX(b ...bool) to return true, if no boolean is set, but false if it's explicitly set to false.
(b []bool)
| 2 | |
| 3 | // WithBoolean helps an option setter (WithXXX(b ...bool) to return true, if no boolean is set, but false if it's explicitly set to false. |
| 4 | func WithBoolean(b []bool) bool { |
| 5 | if len(b) == 0 { |
| 6 | b = append(b, true) |
| 7 | } |
| 8 | return b[0] |
| 9 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…