Skip to content

Latest commit

 

History

History
42 lines (33 loc) · 617 Bytes

README.md

File metadata and controls

42 lines (33 loc) · 617 Bytes

go-usi

This repository is a library for using the USI protocol from Go. For more information on the USI protocol, please see.

Example

main.go

package main

import (
	"context"
	"log"
	"os"

	"github.com/kk-no/go-usi"
)

func main() {
	ctx := context.Background()

	enginePath := os.Getenv("ENGINE_PATH")
	engine, err := usi.New(enginePath)
	if err != nil {
		log.Fatalln(err)
	}

	if err := engine.Connect(ctx); err != nil {
		os.Exit(0)
	}
}

shell

$ go run main.go
$ isready
$ go infinite