1
0
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:
v2ray
2015-12-03 16:57:23 +01:00
parent f3f1c09e49
commit e42510aca5
5 changed files with 58 additions and 32 deletions

33
common/serial/numbers.go Normal file
View 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)
}