Skip to content
Optional values for Go
Go
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
pattern
README.md
basic.go
basic_test.go
seq.go
set.go
set_test.go
tuple.go
tuple_test.go

README.md

Optional Values for Go

Usage

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
}
You can’t perform that action at this time.