UnmarshalText parses access mode string as byte slice. Does not change the mode if the string is empty or invalid.
(b []byte)
| 642 | // UnmarshalText parses access mode string as byte slice. |
| 643 | // Does not change the mode if the string is empty or invalid. |
| 644 | func (m *AccessMode) UnmarshalText(b []byte) error { |
| 645 | m0, err := ParseAcs(b) |
| 646 | if err != nil { |
| 647 | return err |
| 648 | } |
| 649 | |
| 650 | if m0 != ModeUnset { |
| 651 | *m = (m0 & ModeBitmask) |
| 652 | } |
| 653 | return nil |
| 654 | } |
| 655 | |
| 656 | // String returns string representation of AccessMode. |
| 657 | func (m AccessMode) String() string { |
no test coverage detected