SetRawOptions sets a raw json value for the specified path with options. This furnction works the same as SetOptions except that the value is set as a raw block of json. This allows for setting premarshalled json objects.
(json, path, value string, opts *Options)
| 462 | // This furnction works the same as SetOptions except that the value is set |
| 463 | // as a raw block of json. This allows for setting premarshalled json objects. |
| 464 | func SetRawOptions(json, path, value string, opts *Options) (string, error) { |
| 465 | var optimistic bool |
| 466 | if opts != nil { |
| 467 | optimistic = opts.Optimistic |
| 468 | } |
| 469 | res, err := set(json, path, value, false, false, optimistic, false) |
| 470 | if err == errNoChange { |
| 471 | return json, nil |
| 472 | } |
| 473 | return string(res), err |
| 474 | } |
| 475 | |
| 476 | // SetRawBytes sets a raw json value for the specified path. |
| 477 | // If working with bytes, this method preferred over |