Skip to content

Commit

Permalink
Merge pull request #211 from yunginnanet/patch-1
Browse files Browse the repository at this point in the history
Update README.md, make example current and buildable
  • Loading branch information
trapgate authored Feb 26, 2024
2 parents fcabe97 + 7d4517d commit cbbbe22
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,7 @@ package main
import (
"fmt"
"log"
"net"
"net/url"
"time"

"github.com/digitalocean/go-libvirt"
)
Expand All @@ -143,13 +141,14 @@ func main() {
log.Fatalf("failed to connect: %v", err)
}

v, err := l.Version()
v, err := l.ConnectGetLibVersion()
if err != nil {
log.Fatalf("failed to retrieve libvirt version: %v", err)
}
fmt.Println("Version:", v)

domains, err := l.Domains()
flags := libvirt.ConnectListDomainsActive | libvirt.ConnectListDomainsInactive
domains, _, err := l.ConnectListAllDomains(1, flags)
if err != nil {
log.Fatalf("failed to retrieve domains: %v", err)
}
Expand All @@ -160,11 +159,12 @@ func main() {
fmt.Printf("%d\t%s\t%x\n", d.ID, d.Name, d.UUID)
}

if err := l.Disconnect(); err != nil {
if err = l.Disconnect(); err != nil {
log.Fatalf("failed to disconnect: %v", err)
}
}


```

```
Expand Down

0 comments on commit cbbbe22

Please sign in to comment.