-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test main packages for listing other types of thing
- Loading branch information
Matt Turner
committed
Jun 9, 2022
1 parent
aef7d79
commit 3f0854d
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()) | ||
} |