Open
Description
dbus.go::: undefined: dbus.ConnOption
I'm trying a simple test with go-systemd. Nothing fancy. But the build failed with the following error:
# github.com/coreos/go-systemd/dbus
/root/go/pkg/mod/github.com/coreos/[email protected]/dbus/dbus.go:146:47: undefined: dbus.ConnOption
/root/go/pkg/mod/github.com/coreos/[email protected]/dbus/dbus.go:204:53: undefined: dbus.ConnOption
/root/go/pkg/mod/github.com/coreos/[email protected]/dbus/dbus.go:224:58: undefined: dbus.ConnOption
The source code it's just a test:
package main
import (
"fmt"
"github.com/coreos/go-systemd/dbus"
)
func main() {
systemdConnection, _ := dbus.NewSystemdConnection()
listOfUnits, _ := systemdConnection.ListUnits()
for _, unit := range listOfUnits {
fmt.Println(unit.Name)
}
systemdConnection.Close()
}
All I want is to perform basic action in my golang code:
- Get the list of units (running and stopped);
- Get status of a running unit;
- Start/Stop a specific unit;
Does anybody have any idea about what is going on?
Metadata
Assignees
Labels
No labels