33 lines
681 B
Go
33 lines
681 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
tea "github.com/charmbracelet/bubbletea"
|
|
"os"
|
|
"protomolecule/src/decls"
|
|
"protomolecule/src/scanStuff"
|
|
"tinygo.org/x/bluetooth"
|
|
)
|
|
|
|
var initialModel = decls.Model{
|
|
// Our to-do list is just a grocery list
|
|
Choices: []bluetooth.ScanResult{},
|
|
|
|
// A map which indicates which choices are selected. We're using
|
|
// the map like a mathematical set. The keys refer to the indexes
|
|
// of the `choices` slice, above.
|
|
Selected: make(map[int]struct{}),
|
|
}
|
|
|
|
func main() {
|
|
p := tea.NewProgram(initialModel)
|
|
|
|
go scanStuff.Scanners(initialModel, p)
|
|
|
|
if err := p.Start(); err != nil {
|
|
fmt.Printf("Alas, there's been an error: %v", err)
|
|
|
|
os.Exit(1)
|
|
}
|
|
}
|