(b []byte)
| 51 | } |
| 52 | |
| 53 | func (o *dodgifierBuf) Write(b []byte) (n int, err error) { |
| 54 | ilen := len(b) |
| 55 | if msgp.NextType(b) == msgp.StrType { |
| 56 | if o.strIdx == o.dodgifyString { |
| 57 | // Fool msgp into thinking this value is a fixint. msgp will throw |
| 58 | // a type error for this value. |
| 59 | b[0] = 1 |
| 60 | } |
| 61 | o.strIdx++ |
| 62 | } |
| 63 | _, err = o.Buffer.Write(b) |
| 64 | return ilen, err |
| 65 | } |
| 66 | |
| 67 | type strCounter int |
| 68 |