From 90bad135fee2835d1da66280e7ef8f4630e61b67 Mon Sep 17 00:00:00 2001 From: Joonas Kuorilehto Date: Fri, 23 Nov 2018 20:48:47 +0200 Subject: [PATCH] Start using go modules for go1.11 The gitlab CI build failed with alpine due to bug in go 1.11 so switched the image to "latest". --- .gitlab-ci.yml | 12 ++---------- README.md | 14 ++++++++------ go.mod | 3 +++ go.sum | 2 ++ 4 files changed, 15 insertions(+), 16 deletions(-) create mode 100644 go.mod create mode 100644 go.sum diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ad8846e..0d60b1f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,24 +1,16 @@ -image: golang:alpine +image: golang:latest stages: - build - test -before_script: - - mkdir -p /go/src/gitlab.com/jtaimisto - - cp -a $(pwd) /go/src/gitlab.com/jtaimisto/bluewalker - - apk add --no-cache git - - go get golang.org/x/sys/unix - build-main-app: stage: build script: - - cd /go/ - go install gitlab.com/jtaimisto/bluewalker - go install gitlab.com/jtaimisto/bluewalker/listener run-tests: stage: test script: - - cd /go/ - - CGO_ENABLED=0 go test gitlab.com/jtaimisto/bluewalker... + - CGO_ENABLED=0 go test gitlab.com/jtaimisto/bluewalker/... diff --git a/README.md b/README.md index 9715b8e..57b81c3 100644 --- a/README.md +++ b/README.md @@ -9,16 +9,18 @@ devices. ## Installing -Bluewalker needs `golang.org/x/sys/unix` package to be installed, it can -be installed with `go get golang.org/x/sys/unix`. After this package is -installed, Bluewalker can be installed and compiled (on linux) with -`go get gitlab.com/jtaimisto/bluewalker`. You should use go version 1.10 or -higher. +On Linux, with go 1.11 or better installed: + +``` +$ go get gitlab.com/jtaimisto/bluewalker +``` + +This will install the binary to ~/bin by default. ## Usage ``` -Usage of ./bluewalker: +Usage of bluewalker: -active Active scanning -debug diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..269f4ac --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module gitlab.com/jtaimisto/bluewalker + +require golang.org/x/sys v0.0.0-20181128092732-4ed8d59d0b35 diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..d385fee --- /dev/null +++ b/go.sum @@ -0,0 +1,2 @@ +golang.org/x/sys v0.0.0-20181128092732-4ed8d59d0b35 h1:YAFjXN64LMvktoUZH9zgY4lGc/msGN7HQfoSuKCgaDU= +golang.org/x/sys v0.0.0-20181128092732-4ed8d59d0b35/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -- GitLab