mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-05-05 20:19:15 -04:00
more literals
This commit is contained in:
33
common/serial/numbers.go
Normal file
33
common/serial/numbers.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package serial
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
)
|
||||
|
||||
type Uint16 interface {
|
||||
Value() uint16
|
||||
}
|
||||
|
||||
type Uint16Literal uint16
|
||||
|
||||
func (this Uint16Literal) String() string {
|
||||
return strconv.Itoa(int(this))
|
||||
}
|
||||
|
||||
func (this Uint16Literal) Value() uint16 {
|
||||
return uint16(this)
|
||||
}
|
||||
|
||||
type Int interface {
|
||||
Value() int
|
||||
}
|
||||
|
||||
type IntLiteral int
|
||||
|
||||
func (this IntLiteral) String() string {
|
||||
return strconv.Itoa(int(this))
|
||||
}
|
||||
|
||||
func (this IntLiteral) Value() int {
|
||||
return int(this)
|
||||
}
|
||||
Reference in New Issue
Block a user