MustEncodeSet is like EncodeSet but panics if the mutation cannot be encoded. It simplifies safe initialization of global variables holding mutations.
(path, body string, rev int64)
| 151 | // encoded. It simplifies safe initialization of global variables holding |
| 152 | // mutations. |
| 153 | func MustEncodeSet(path, body string, rev int64) (mutation string) { |
| 154 | m, err := EncodeSet(path, body, rev) |
| 155 | if err != nil { |
| 156 | panic(err) |
| 157 | } |
| 158 | return m |
| 159 | } |
| 160 | |
| 161 | // MustEncodeDel is like EncodeDel but panics if the mutation cannot be |
| 162 | // encoded. It simplifies safe initialization of global variables holding |