ApplyMutation sets of modifies access mode: * if `mutation` contains either '+' or '-', attempts to apply a delta change on `m`. * otherwise, treats it as an assignment.
(mutation string)
| 736 | // * if `mutation` contains either '+' or '-', attempts to apply a delta change on `m`. |
| 737 | // * otherwise, treats it as an assignment. |
| 738 | func (m *AccessMode) ApplyMutation(mutation string) error { |
| 739 | if mutation == "" { |
| 740 | return nil |
| 741 | } |
| 742 | if strings.ContainsAny(mutation, "+-") { |
| 743 | return m.ApplyDelta(mutation) |
| 744 | } |
| 745 | return m.UnmarshalText([]byte(mutation)) |
| 746 | } |
| 747 | |
| 748 | // ApplyDelta applies the acs delta to AccessMode. |
| 749 | // Delta is in the same format as generated by AccessMode.Delta. |
no test coverage detected