Validate checks the marker bytes and version of the meta page to ensure it matches this binary.
()
| 23 | |
| 24 | // Validate checks the marker bytes and version of the meta page to ensure it matches this binary. |
| 25 | func (m *Meta) Validate() error { |
| 26 | if m.magic != Magic { |
| 27 | return errors.ErrInvalid |
| 28 | } else if m.version != Version { |
| 29 | return errors.ErrVersionMismatch |
| 30 | } else if m.checksum != m.Sum64() { |
| 31 | return errors.ErrChecksum |
| 32 | } |
| 33 | return nil |
| 34 | } |
| 35 | |
| 36 | // Copy copies one meta object to another. |
| 37 | func (m *Meta) Copy(dest *Meta) { |
no test coverage detected