Created
July 14, 2015 21:03
-
-
Save karlmutch/bdc597bf20f5a94a2130 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
| var ( | |
| Web = fakeSearch("web") | |
| Image = fakeSearch("image") | |
| Video = fakeSearch("video") | |
| ) | |
| type Search func(query string) Result | |
| func fakeSearch(kind string) Search { | |
| return func(query string) Result { | |
| time.Sleep(time.Duration(rand.Intn(100)) * time.Millisecond) | |
| return Result(fmt.Sprintf("%s result for %q\n", kind, query)) | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment