Created
February 21, 2017 02:32
-
-
Save ken39arg/9c7f45efaf4a190b4d4cdc4795fcdcf1 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
| package test | |
| import "reflect" | |
| func SliceEqualBy(slice interface{}, checkFun func(i int) bool) bool { | |
| rv := reflect.ValueOf(slice) | |
| for i := 0; i < rv.Len(); i++ { | |
| if !checkFun(i) { | |
| return false | |
| } | |
| } | |
| return true | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.