(version int)
| 93 | } = versionedMsgsV1{} |
| 94 | |
| 95 | func SetFormatVersion(version int) error { |
| 96 | switch version { |
| 97 | case 1: |
| 98 | VersionedMsgs = versionedMsgsV1{} |
| 99 | return nil |
| 100 | case 2: |
| 101 | VersionedMsgs = versionedMsgsV2{} |
| 102 | return nil |
| 103 | default: |
| 104 | VersionedMsgs = versionedMsgsV1{} |
| 105 | return fmt.Errorf("unrecognized log format version: %d, using version 1", version) |
| 106 | } |
| 107 | } |