Skip to content

Commit

Permalink
Test main packages for listing other types of thing
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Turner committed Jun 9, 2022
1 parent aef7d79 commit 3f0854d
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
21 changes: 21 additions & 0 deletions cmd/bt/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package main

import "tinygo.org/x/bluetooth"
import "fmt"

func main() {
var err error

var adapter = bluetooth.DefaultAdapter
err = adapter.Enable()
if err != nil {
panic(err)
}

err = adapter.Scan(func(adapter *bluetooth.Adapter, device bluetooth.ScanResult) {
fmt.Println("found device:", device.Address.String(), device.RSSI, device.LocalName())
})
if err != nil {
panic(err)
}
}
21 changes: 21 additions & 0 deletions cmd/whois/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package main

import (
"context"
"fmt"

"github.com/domainr/whois"
)

func main() {
req, err := whois.NewRequest("bcube.co.uk")
if err != nil {
panic(err)
}
w := whois.NewClient(0)
res, err := w.FetchContext(context.TODO(), req)
if err != nil {
panic(err)
}
fmt.Println(res.String())
}

0 comments on commit 3f0854d

Please sign in to comment.