Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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
}

About

Optional values for Go

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages