Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Fix example code
Browse files Browse the repository at this point in the history
  • Loading branch information
gvalkov committed Sep 25, 2016
1 parent 9393f92 commit 982fbe8
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions example_test.go
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
package evdev_test

import (
. "evdev"
"fmt"
"github.com/gvalkov/golang-evdev"
)

func ExampleOpen() {
device := Open("/dev/input/event3")
device, _ := Open("/dev/input/event3")
fmt.Println(device)
}

// Listing accessible input devices.
func ExampleListInputdevices() {
devices, err := evdev.ListInputDevices()
func ExampleListInputDevices() {
devices, _ := evdev.ListInputDevices()

for _, dev := range devices {
fmt.Printf("%s %s %s", dev.Fn, dev.Name, dev.Phys)
}
}

func Example() {
device := Open("/dev/input/event3")
device, _ := Open("/dev/input/event3")

fmt.Println(device)
// InputDevice /dev/input/event3 (fd 3)
Expand All @@ -38,5 +40,4 @@ func Example() {
// 0:[0 1 2 4]
// 2:[0 1 6 8 272 273 274 275 276 277 278 279]
// 1:[272 273 274 275 276 277 278 279] ]

}

0 comments on commit 982fbe8

Please sign in to comment.