mirror of
https://github.com/tursom/GoCollections.git
synced 2025-03-15 18:36:56 +08:00
16 lines
186 B
Go
16 lines
186 B
Go
package lang
|
|
|
|
type Int int
|
|
|
|
func (i Int) Equals(e Object) bool {
|
|
i2, ok := e.(Int)
|
|
if !ok {
|
|
return false
|
|
}
|
|
return i == i2
|
|
}
|
|
|
|
func (i Int) Compare(t Int) int {
|
|
return int(t - i)
|
|
}
|