Skip to content

undefined: dbus.ConnOption #456

Open
@WillianBR

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:

  1. Get the list of units (running and stopped);
  2. Get status of a running unit;
  3. Start/Stop a specific unit;

Does anybody have any idea about what is going on?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions