[client.keyset] added Getter and Setter 'MigrationCode(<uint8|nil>) uint8' for migration code
This commit is contained in:
parent
8ef698f4c3
commit
27dcb81e5f
|
@ -183,3 +183,26 @@ func (s *T) Fetch(reader io.Reader) error {
|
|||
return nil
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* (6) Getter/Setter for migration code 'mcode'
|
||||
*
|
||||
* @mcode<uint8> [OPT] New value
|
||||
*
|
||||
* @return mcode<uint8> Migration code
|
||||
*
|
||||
---------------------------------------------------------*/
|
||||
func (s T) MigrationCode(optional... uint8) uint8 {
|
||||
|
||||
/* (1) If no valid code given -> return current one */
|
||||
if len(optional) < 1 || optional[0] > 3 {
|
||||
return s.mcode
|
||||
}
|
||||
|
||||
/* (2) Set new code */
|
||||
s.mcode = optional[0]
|
||||
|
||||
/* (3) Return new code */
|
||||
return s.mcode
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue