From b5f71cb3973efe08832ad8cbcabd6d953afbec4a Mon Sep 17 00:00:00 2001 From: Sascha Grunert Date: Wed, 15 May 2019 09:41:23 +0200 Subject: [PATCH] Add go module support Signed-off-by: Sascha Grunert --- .gitignore | 1 + .travis.yml | 7 +++---- Gopkg.toml | 7 ------- README.md | 2 +- dbus/dbus.go | 2 +- dbus/methods.go | 2 +- dbus/methods_test.go | 2 +- dbus/properties.go | 4 ++-- dbus/subscription.go | 2 +- examples/activation/activation.go | 2 +- examples/activation/httpserver/httpserver.go | 2 +- examples/activation/listen.go | 2 +- examples/activation/udpconn.go | 2 +- go.mod | 5 +++++ go.sum | 2 ++ import1/dbus.go | 2 +- login1/dbus.go | 2 +- machine1/dbus.go | 4 ++-- machine1/dbus_test.go | 4 ++-- sdjournal/functions.go | 2 +- sdjournal/journal_test.go | 2 +- util/util_cgo.go | 2 +- 22 files changed, 31 insertions(+), 31 deletions(-) create mode 100644 .gitignore delete mode 100644 Gopkg.toml create mode 100644 go.mod create mode 100644 go.sum diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..93ea1171 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +test_bins diff --git a/.travis.yml b/.travis.yml index cfea999c..32f81e76 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,14 +5,15 @@ services: language: go go: - - "1.10.x" - - "1.11.x" + - "1.12.x" + - "1.13.x" go_import_path: github.com/coreos/go-systemd env: global: - IMPORTPATH=github.com/coreos/go-systemd - GOPATH=/opt + - GO111MODULE=on - DEP_BINDIR=/tmp - BUILD_DIR=/opt/src/github.com/coreos/go-systemd matrix: @@ -23,8 +24,6 @@ env: before_install: - sudo apt-get -qq update - sudo apt-get install -y libsystemd-journal-dev libsystemd-daemon-dev - - curl https://raw.githubusercontent.com/golang/dep/master/install.sh | INSTALL_DIRECTORY=${DEP_BINDIR} sh - - ${DEP_BINDIR}/dep ensure -v - docker pull ${DOCKER_BASE} - docker run --privileged -e GOPATH=${GOPATH} --cidfile=/tmp/cidfile ${DOCKER_BASE} /bin/bash -c "apt-get update && apt-get install -y sudo build-essential git golang dbus libsystemd-dev libpam-systemd systemd-container" - docker commit `cat /tmp/cidfile` go-systemd/container-tests diff --git a/Gopkg.toml b/Gopkg.toml deleted file mode 100644 index 8d3cb550..00000000 --- a/Gopkg.toml +++ /dev/null @@ -1,7 +0,0 @@ -[[constraint]] - name = "github.com/godbus/dbus" - version = "5.0" - -[prune] - go-tests = true - unused-packages = true diff --git a/README.md b/README.md index cde3a8f9..b83d0683 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Build Status](https://travis-ci.org/coreos/go-systemd.png?branch=master)](https://travis-ci.org/coreos/go-systemd) [![godoc](https://godoc.org/github.com/coreos/go-systemd?status.svg)](http://godoc.org/github.com/coreos/go-systemd) -![minimum golang 1.10](https://img.shields.io/badge/golang-1.10%2B-orange.svg) +![minimum golang 1.12](https://img.shields.io/badge/golang-1.12%2B-orange.svg) Go bindings to systemd. The project has several packages: diff --git a/dbus/dbus.go b/dbus/dbus.go index f652582e..91584a16 100644 --- a/dbus/dbus.go +++ b/dbus/dbus.go @@ -23,7 +23,7 @@ import ( "strings" "sync" - "github.com/godbus/dbus" + "github.com/godbus/dbus/v5" ) const ( diff --git a/dbus/methods.go b/dbus/methods.go index 5859583e..e38659d7 100644 --- a/dbus/methods.go +++ b/dbus/methods.go @@ -20,7 +20,7 @@ import ( "path" "strconv" - "github.com/godbus/dbus" + "github.com/godbus/dbus/v5" ) func (c *Conn) jobComplete(signal *dbus.Signal) { diff --git a/dbus/methods_test.go b/dbus/methods_test.go index 061605bf..48ed52c2 100644 --- a/dbus/methods_test.go +++ b/dbus/methods_test.go @@ -25,7 +25,7 @@ import ( "testing" "time" - "github.com/godbus/dbus" + "github.com/godbus/dbus/v5" ) type TrUnitProp struct { diff --git a/dbus/properties.go b/dbus/properties.go index 6c818958..fb42b627 100644 --- a/dbus/properties.go +++ b/dbus/properties.go @@ -15,7 +15,7 @@ package dbus import ( - "github.com/godbus/dbus" + "github.com/godbus/dbus/v5" ) // From the systemd docs: @@ -56,7 +56,7 @@ type execStart struct { // http://www.freedesktop.org/software/systemd/man/systemd.service.html#ExecStart= func PropExecStart(command []string, uncleanIsFailure bool) Property { execStarts := []execStart{ - execStart{ + { Path: command[0], Args: command, UncleanIsFailure: uncleanIsFailure, diff --git a/dbus/subscription.go b/dbus/subscription.go index f6d7a08a..7e370fea 100644 --- a/dbus/subscription.go +++ b/dbus/subscription.go @@ -19,7 +19,7 @@ import ( "log" "time" - "github.com/godbus/dbus" + "github.com/godbus/dbus/v5" ) const ( diff --git a/examples/activation/activation.go b/examples/activation/activation.go index a1e6fa33..1c0e6623 100644 --- a/examples/activation/activation.go +++ b/examples/activation/activation.go @@ -21,7 +21,7 @@ import ( "fmt" "os" - "github.com/coreos/go-systemd/activation" + "github.com/coreos/go-systemd/v21/activation" ) func fixListenPid() { diff --git a/examples/activation/httpserver/httpserver.go b/examples/activation/httpserver/httpserver.go index 059316cb..be220018 100644 --- a/examples/activation/httpserver/httpserver.go +++ b/examples/activation/httpserver/httpserver.go @@ -20,7 +20,7 @@ import ( "io" "net/http" - "github.com/coreos/go-systemd/activation" + "github.com/coreos/go-systemd/v21/activation" ) func HelloServer(w http.ResponseWriter, req *http.Request) { diff --git a/examples/activation/listen.go b/examples/activation/listen.go index b1774b81..e2d236e4 100644 --- a/examples/activation/listen.go +++ b/examples/activation/listen.go @@ -21,7 +21,7 @@ import ( "fmt" "os" - "github.com/coreos/go-systemd/activation" + "github.com/coreos/go-systemd/v21/activation" ) func fixListenPid() { diff --git a/examples/activation/udpconn.go b/examples/activation/udpconn.go index 73b586ac..fcafbc65 100644 --- a/examples/activation/udpconn.go +++ b/examples/activation/udpconn.go @@ -22,7 +22,7 @@ import ( "net" "os" - "github.com/coreos/go-systemd/activation" + "github.com/coreos/go-systemd/v21/activation" ) func fixListenPid() { diff --git a/go.mod b/go.mod new file mode 100644 index 00000000..2f20d8cb --- /dev/null +++ b/go.mod @@ -0,0 +1,5 @@ +module github.com/coreos/go-systemd/v21 + +go 1.12 + +require github.com/godbus/dbus/v5 v5.0.3 diff --git a/go.sum b/go.sum new file mode 100644 index 00000000..ce3cb399 --- /dev/null +++ b/go.sum @@ -0,0 +1,2 @@ +github.com/godbus/dbus/v5 v5.0.3 h1:ZqHaoEF7TBzh4jzPmqVhE/5A1z9of6orkAe5uHoAeME= +github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= diff --git a/import1/dbus.go b/import1/dbus.go index c946c0fd..8076b21d 100644 --- a/import1/dbus.go +++ b/import1/dbus.go @@ -22,7 +22,7 @@ import ( "strconv" "strings" - "github.com/godbus/dbus" + "github.com/godbus/dbus/v5" ) const ( diff --git a/login1/dbus.go b/login1/dbus.go index 6d2c99bc..74bb6487 100644 --- a/login1/dbus.go +++ b/login1/dbus.go @@ -20,7 +20,7 @@ import ( "os" "strconv" - "github.com/godbus/dbus" + "github.com/godbus/dbus/v5" ) const ( diff --git a/machine1/dbus.go b/machine1/dbus.go index cde97dbe..3a947112 100644 --- a/machine1/dbus.go +++ b/machine1/dbus.go @@ -23,9 +23,9 @@ import ( "strconv" "syscall" - "github.com/godbus/dbus" + "github.com/godbus/dbus/v5" - sd_dbus "github.com/coreos/go-systemd/dbus" + sd_dbus "github.com/coreos/go-systemd/v21/dbus" ) const ( diff --git a/machine1/dbus_test.go b/machine1/dbus_test.go index fec3b4f7..a7619d43 100644 --- a/machine1/dbus_test.go +++ b/machine1/dbus_test.go @@ -25,8 +25,8 @@ import ( "testing" "time" - sd_dbus "github.com/coreos/go-systemd/dbus" - "github.com/godbus/dbus" + sd_dbus "github.com/coreos/go-systemd/v21/dbus" + "github.com/godbus/dbus/v5" ) const ( diff --git a/sdjournal/functions.go b/sdjournal/functions.go index 06aaca14..93c9e25e 100644 --- a/sdjournal/functions.go +++ b/sdjournal/functions.go @@ -16,7 +16,7 @@ package sdjournal import ( - "github.com/coreos/go-systemd/internal/dlopen" + "github.com/coreos/go-systemd/v21/internal/dlopen" "sync" "unsafe" ) diff --git a/sdjournal/journal_test.go b/sdjournal/journal_test.go index c597e4cc..bf7f3b8f 100755 --- a/sdjournal/journal_test.go +++ b/sdjournal/journal_test.go @@ -27,7 +27,7 @@ import ( "testing" "time" - "github.com/coreos/go-systemd/journal" + "github.com/coreos/go-systemd/v21/journal" ) func TestJournalFollow(t *testing.T) { diff --git a/util/util_cgo.go b/util/util_cgo.go index b683b168..aa164028 100644 --- a/util/util_cgo.go +++ b/util/util_cgo.go @@ -58,7 +58,7 @@ import ( "syscall" "unsafe" - "github.com/coreos/go-systemd/internal/dlopen" + "github.com/coreos/go-systemd/v21/internal/dlopen" ) var libsystemdNames = []string{