Created
August 19, 2012 13:26
-
-
Save crufter/3394773 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In package btree: | |
type Comper interface { | |
Less(Comper) bool | |
Eq(Comper) bool | |
} | |
============================================== | |
type Int int | |
func (i Int) Less(c btree.Comper) bool { | |
a, ok := c.(Int) | |
if !ok { | |
return false | |
} | |
return i < a | |
} | |
func (i Int) Eq(c btree.Comper) bool { | |
a, ok := c.(Int) | |
if !ok { | |
return false | |
} | |
return i == a | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment