func (eng *Engine) Go(depth int, searchmoves string, movetime int64, resultOpts ...uint) (*Results, error) {
	res := Results{}
	resultOpt := uint(0)
	if len(resultOpts) == 1 {
		resultOpt = resultOpts[0]
	}
	goCmd := "go "
	if depth != 0 {
		goCmd += fmt.Sprintf("depth %d", depth)
	}
	if searchmoves != "" {
		goCmd += fmt.Sprintf(" searchmoves %s", searchmoves)
	}
	if movetime != 0 {
		goCmd += fmt.Sprintf(" movetime %d", movetime)
	}
	goCmd += "\n"
	_, err := eng.stdin.WriteString(goCmd)
	if err != nil {
		return nil, err
	}
	err = eng.stdin.Flush()
	if err != nil {
		return nil, err
	}
	for {
		line, err := eng.stdout.ReadString('\n')
		if err != nil {
			return nil, err
		}
		line = strings.Trim(line, "\n")
		if strings.HasPrefix(line, "bestmove") {
			dummy := ""
			_, err := fmt.Sscanf(line, "%s %s", &dummy, &res.BestMove)
			if err != nil {
				return nil, err
			}
			break
		}
		err = res.addLineToResults(line)
		if err != nil {
			return nil, err
		}
	}
	for _, v := range res.results {
		if resultOpt&HighestDepthOnly != 0 && v.Depth != depth {
			continue
		}
		if resultOpt&IncludeUpperbounds == 0 && v.Upperbound {
			continue
		}
		if resultOpt&IncludeLowerbounds == 0 && v.Lowerbound {
			continue
		}
		res.Results = append(res.Results, v)
	}
	sort.Sort(byDepth(res.Results))
	return &res, nil
}
Go can use search moves, depth and time to move as filter  for the results being returned.
see http://wbec-ridderkerk.nl/html/UCIProtocol.html
package uci
import (
	"bufio"
	"encoding/json"
	"fmt"
	"log"
	"os/exec"
	"sort"
	"strconv"
	"strings"
	"text/scanner"
)
const (
	HighestDepthOnly   uint = 1 << iota  
	IncludeUpperbounds uint = 1 << iota  
	IncludeLowerbounds uint = 1 << iota  
)
type Options struct {
	MultiPV int   
	Hash    int   
	Ponder  bool  
	OwnBook bool  
	Threads int   
}
type scoreKey struct {
	Depth      int
	MultiPV    int
	Upperbound bool
	Lowerbound bool
}
type ScoreResult struct {
	Time           int       
	Depth          int       
	SelDepth       int       
	Nodes          int       
	NodesPerSecond int       
	MultiPV        int       
	Lowerbound     bool      
	Upperbound     bool      
	Score          int       
	Mate           bool      
	BestMoves      []string  
}
type Results struct {
	BestMove string
	results  map[scoreKey]ScoreResult
	Results  []ScoreResult
}
func (r Results) String() string {
	b, _ := json.MarshalIndent(r, "", "  ")
	return fmt.Sprintln(string(b))
}
type Engine struct {
	cmd    *exec.Cmd
	stdout *bufio.Reader
	stdin  *bufio.Writer
}
func NewEngine(path string, arg ...string) (*Engine, error) {
	eng := Engine{}
	eng.cmd = exec.Command(path, arg...)
	stdin, err := eng.cmd.StdinPipe()
	if err != nil {
		return nil, err
	}
	stdout, err := eng.cmd.StdoutPipe()
	if err != nil {
		return nil, err
	}
	if err := eng.cmd.Start(); err != nil {
		return nil, err
	}
	eng.stdin = bufio.NewWriter(stdin)
	eng.stdout = bufio.NewReader(stdout)
	return &eng, nil
}
func (eng *Engine) SetOptions(opt Options) error {
	var err error
	if opt.MultiPV > 0 {
		err = eng.SendOption("multipv", opt.MultiPV)
		if err != nil {
			return err
		}
	}
	if opt.Hash > 0 {
		err = eng.SendOption("hash", opt.Hash)
		if err != nil {
			return err
		}
	}
	if opt.Threads > 0 {
		err = eng.SendOption("threads", opt.Threads)
		if err != nil {
			return err
		}
	}
	err = eng.SendOption("ownbook", opt.OwnBook)
	if err != nil {
		return err
	}
	err = eng.SendOption("ponder", opt.Ponder)
	if err != nil {
		return err
	}
	return err
}
func (eng *Engine) SendOption(name string, value interface{}) error {
	_, err := eng.stdin.WriteString(fmt.Sprintf("setoption name %s value %v\n", name, value))
	if err != nil {
		return err
	}
	err = eng.stdin.Flush()
	return err
}
func (eng *Engine) SetFEN(fen string) error {
	_, err := eng.stdin.WriteString(fmt.Sprintf("position fen %s\n", fen))
	if err != nil {
		return err
	}
	err = eng.stdin.Flush()
	return err
}
func (eng *Engine) SetMoves(moves string) error {
	_, err := eng.stdin.WriteString(fmt.Sprintf("position startpos moves %s\n", moves))
	if err != nil {
		return err
	}
	err = eng.stdin.Flush()
	return err
}