type Person struct {
Name string
Age int
}
type Query struct {
Name *String
Age *Int
}
func search(q *Query, ps []*Person) []*Person {
var result []*Person{}
for _, p := range ps {
if q.Name.Match(p.Name) && q.Age.Match(p.Age) {
result = append(result, p)
}
}
return result
}
-
Notifications
You must be signed in to change notification settings - Fork 0
tenntenn/optional
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Optional values for Go
Topics
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published