AppendBools encodes the input bools to json and appends the encoded string list to the input byte slice.
(dst []byte, vals []bool)
| 55 | // AppendBools encodes the input bools to json and |
| 56 | // appends the encoded string list to the input byte slice. |
| 57 | func (Encoder) AppendBools(dst []byte, vals []bool) []byte { |
| 58 | if len(vals) == 0 { |
| 59 | return append(dst, '[', ']') |
| 60 | } |
| 61 | dst = append(dst, '[') |
| 62 | dst = strconv.AppendBool(dst, vals[0]) |
| 63 | if len(vals) > 1 { |
| 64 | for _, val := range vals[1:] { |
| 65 | dst = strconv.AppendBool(append(dst, ','), val) |
| 66 | } |
| 67 | } |
| 68 | dst = append(dst, ']') |
| 69 | return dst |
| 70 | } |
| 71 | |
| 72 | // AppendInt converts the input int to a string and |
| 73 | // appends the encoded string to the input byte slice. |
nothing calls this directly
no test coverage detected