feat(Go-Tool):
2020/12/16: 添加YAML和结构体转换工具
This commit is contained in:
+11
-11
@@ -2,21 +2,21 @@ package linq
|
||||
|
||||
type comparer func(interface{}, interface{}) int
|
||||
|
||||
// Comparable is an interface that has to be implemented by a
|
||||
// custom collection elememts in order to work with linq.
|
||||
// Comparable is an interface that has to be implemented by a custom collection
|
||||
// elememts in order to work with linq.
|
||||
//
|
||||
// Example:
|
||||
// func (f foo) CompareTo(c Comparable) int {
|
||||
// a, b := f.f1, c.(foo).f1
|
||||
// func (f foo) CompareTo(c Comparable) int {
|
||||
// a, b := f.f1, c.(foo).f1
|
||||
//
|
||||
// if a < b {
|
||||
// return -1
|
||||
// } else if a > b {
|
||||
// return 1
|
||||
// }
|
||||
// if a < b {
|
||||
// return -1
|
||||
// } else if a > b {
|
||||
// return 1
|
||||
// }
|
||||
//
|
||||
// return 0
|
||||
// }
|
||||
// return 0
|
||||
// }
|
||||
type Comparable interface {
|
||||
CompareTo(Comparable) int
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user