From 0e9eb4e0f90099a7be9f3903dd0e685dda1a4a8c Mon Sep 17 00:00:00 2001 From: michael1011 Date: Tue, 12 Feb 2019 17:03:01 +0100 Subject: [PATCH] switch to Go Modules --- .travis.yml | 8 +-- Gopkg.lock | 162 ---------------------------------------------------- Gopkg.toml | 27 --------- Makefile | 21 ++----- README.md | 7 ++- go.mod | 17 ++++++ go.sum | 26 +++++++++ 7 files changed, 53 insertions(+), 215 deletions(-) delete mode 100644 Gopkg.lock delete mode 100644 Gopkg.toml create mode 100644 go.mod create mode 100644 go.sum diff --git a/.travis.yml b/.travis.yml index 5fba2ae..e00e44c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,8 @@ language: go -cache: - directories: - - "vendor" - go: - - "1.10" - - "1.11" + - "1.11.4" script: - - make dep - make build - make lint diff --git a/Gopkg.lock b/Gopkg.lock deleted file mode 100644 index c87572f..0000000 --- a/Gopkg.lock +++ /dev/null @@ -1,162 +0,0 @@ -# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. - - -[[projects]] - branch = "master" - digest = "1:eed1efee98f5d335e09757758cb86542df2b9f99be0b95e030963eeb0b192639" - name = "github.com/donovanhide/eventsource" - packages = ["."] - pruneopts = "UT" - revision = "3ed64d21fb0b6bd8b49bcfec08f3004daee8723d" - -[[projects]] - digest = "1:19c3d5be42d5d503b94650e45bb2a01264bb36caff20f708e9cf67a6683b4c04" - name = "github.com/golang/protobuf" - packages = [ - "jsonpb", - "proto", - "protoc-gen-go/descriptor", - "ptypes/any", - "ptypes/struct", - ] - pruneopts = "UT" - revision = "bbd03ef6da3a115852eaf24c8a1c46aeb39aa175" - -[[projects]] - digest = "1:983bdae4397d2a7c88316865e7de6b76bbedd8c33342004931829eba0975d9ed" - name = "github.com/grpc-ecosystem/grpc-gateway" - packages = [ - "runtime", - "runtime/internal", - "utilities", - ] - pruneopts = "UT" - revision = "f2862b476edcef83412c7af8687c9cd8e4097c0f" - -[[projects]] - digest = "1:a2cff208d4759f6ba1b1cd228587b0a1869f95f22542ec9cd17fff64430113c7" - name = "github.com/jessevdk/go-flags" - packages = ["."] - pruneopts = "UT" - revision = "c6ca198ec95c841fdb89fc0de7496fed11ab854e" - version = "v1.4.0" - -[[projects]] - digest = "1:f57313e3a5ad276ee58d068ce6e643a014ef934535426f70f9f8129e43ce8074" - name = "github.com/lightningnetwork/lnd" - packages = ["lnrpc"] - pruneopts = "UT" - revision = "73af09a06ae9cd5ba92a376e8253ae5450fe09cc" - version = "v0.5-beta-rc1" - -[[projects]] - digest = "1:3cafc6a5a1b8269605d9df4c6956d43d8011fc57f266ca6b9d04da6c09dee548" - name = "github.com/mattn/go-sqlite3" - packages = ["."] - pruneopts = "UT" - revision = "25ecb14adfc7543176f7d85291ec7dba82c6f7e4" - version = "v1.9.0" - -[[projects]] - digest = "1:5b3b29ce0e569f62935d9541dff2e16cc09df981ebde48e82259076a73a3d0c7" - name = "github.com/op/go-logging" - packages = ["."] - pruneopts = "UT" - revision = "b2cb9fa56473e98db8caba80237377e83fe44db5" - version = "v1" - -[[projects]] - digest = "1:b24d38b282bacf9791408a080f606370efa3d364e4b5fd9ba0f7b87786d3b679" - name = "github.com/urfave/cli" - packages = ["."] - pruneopts = "UT" - revision = "cfb38830724cc34fedffe9a2a29fb54fa9169cd1" - version = "v1.20.0" - -[[projects]] - digest = "1:279284b3cc1429d8ea79402792b17c5dbfadd583ec4963db69f0368762f89be4" - name = "golang.org/x/net" - packages = [ - "context", - "http2", - "http2/hpack", - "idna", - "internal/timeseries", - "lex/httplex", - "trace", - ] - pruneopts = "UT" - revision = "ae89d30ce0c63142b652837da33d782e2b0a9b25" - -[[projects]] - digest = "1:a2ab62866c75542dd18d2b069fec854577a20211d7c0ea6ae746072a1dccdd18" - name = "golang.org/x/text" - packages = [ - "collate", - "collate/build", - "internal/colltab", - "internal/gen", - "internal/tag", - "internal/triegen", - "internal/ucd", - "language", - "secure/bidirule", - "transform", - "unicode/bidi", - "unicode/cldr", - "unicode/norm", - "unicode/rangetable", - ] - pruneopts = "UT" - revision = "f21a4dfb5e38f5895301dc265a8def02365cc3d0" - version = "v0.3.0" - -[[projects]] - digest = "1:c2dee8dbcc504d1a7858f5dbaed7c8b256c512c5e9e81480158c30185bbd2792" - name = "google.golang.org/genproto" - packages = [ - "googleapis/api/annotations", - "googleapis/rpc/status", - ] - pruneopts = "UT" - revision = "df60624c1e9b9d2973e889c7a1cff73155da81c4" - -[[projects]] - digest = "1:8d9ccf0a790b530f94357a5d27e9c86fb53e862b6e0f9133c792269c0b567218" - name = "google.golang.org/grpc" - packages = [ - ".", - "codes", - "connectivity", - "credentials", - "grpclb/grpc_lb_v1", - "grpclog", - "internal", - "keepalive", - "metadata", - "naming", - "peer", - "stats", - "status", - "tap", - "transport", - ] - pruneopts = "UT" - revision = "b3ddf786825de56a4178401b7e174ee332173b66" - -[solve-meta] - analyzer-name = "dep" - analyzer-version = 1 - input-imports = [ - "github.com/donovanhide/eventsource", - "github.com/jessevdk/go-flags", - "github.com/lightningnetwork/lnd/lnrpc", - "github.com/mattn/go-sqlite3", - "github.com/op/go-logging", - "github.com/urfave/cli", - "google.golang.org/grpc", - "google.golang.org/grpc/credentials", - "google.golang.org/grpc/metadata", - ] - solver-name = "gps-cdcl" - solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml deleted file mode 100644 index 208a598..0000000 --- a/Gopkg.toml +++ /dev/null @@ -1,27 +0,0 @@ -[[constraint]] - name = "github.com/mattn/go-sqlite3" - version = "1.6.0" - -[[constraint]] - name = "github.com/donovanhide/eventsource" - branch = "master" - -[[constraint]] - name = "github.com/jessevdk/go-flags" - version = "1.4.0" - -[[constraint]] - name = "github.com/lightningnetwork/lnd" - version = "0.5-beta-rc1" - -[[constraint]] - name = "github.com/op/go-logging" - version = "1.0.0" - -[[constraint]] - name = "github.com/urfave/cli" - version = "1.20.0" - -[prune] - go-tests = true - unused-packages = true diff --git a/Makefile b/Makefile index c2ad95c..f6d930f 100644 --- a/Makefile +++ b/Makefile @@ -1,25 +1,19 @@ PKG := github.com/michael1011/lightningtip -GOBUILD := go build -v -GOINSTALL := go install -v +GOBUILD := GO111MODULE=on go build -v +GOINSTALL := GO111MODULE=on go install -v GO_BIN := ${GOPATH}/bin -DEP_BIN := $(GO_BIN)/dep LINT_BIN := $(GO_BIN)/gometalinter.v2 -HAVE_DEP := $(shell command -v $(DEP_BIN) 2> /dev/null) HAVE_LINTER := $(shell command -v $(LINT_BIN) 2> /dev/null) -default: dep build +default: build $(LINT_BIN): @$(call print, "Fetching gometalinter.v2") go get -u gopkg.in/alecthomas/gometalinter.v2 -$(DEP_BIN): - @$(call print, "Fetching dep") - go get -u github.com/golang/dep/cmd/dep - GREEN := "\\033[0;32m" NC := "\\033[0m" @@ -39,12 +33,6 @@ LINT = $(LINT_BIN) \ grep -v 'ALL_CAPS\|OP_' 2>&1 | \ tee /dev/stderr -# Dependencies - -dep: $(DEP_BIN) - @$(call print, "Compiling dependencies") - dep ensure -v - # Building build: @@ -65,5 +53,6 @@ fmt: lint: $(LINT_BIN) @$(call print, "Linting source") - $(LINT_BIN) --install 1> /dev/null + GO111MODULE=on go mod vendor + GO111MODULE=off $(LINT_BIN) --install 1> /dev/null test -z "$$($(LINT))" diff --git a/README.md b/README.md index 2fc898e..c6c6200 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # LightningTip + A simple way to accept tips via the Lightning Network on your website. If want to tip me you can find my instance of LightningTip [here](https://michael1011.at/lightning.html). [robclark56](https://github.com/robclark56) forked LightningTip and rewrote the backend in **PHP**. His fork is called [LightningTip-PHP](https://github.com/robclark56/lightningtip) and is a great alternative if you are not able to run the executable. @@ -33,9 +34,9 @@ That's it! The only two things you need to take care about is keeping the LND no ## How to build -First of all make sure [Golang](https://golang.org/) and [Dep](https://github.com/golang/dep) are both correctly installed. Golang version 1.10 or newer is recommended. +First of all make sure [Golang](https://golang.org/) version 1.11 or newer is correctly installed. -``` +```bash go get -d github.com/michael1011/lightningtip cd $GOPATH/src/github.com/michael1011/lightningtip @@ -48,7 +49,7 @@ To start run `$GOPATH/bin/lightningtip` or follow the instructions below to setu Make sure you stop any running LightningTip process before upgrading, then pull from source as follows: -``` +```bash cd $GOPATH/src/github.com/michael1011/lightningtip git pull diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..f9bc0e1 --- /dev/null +++ b/go.mod @@ -0,0 +1,17 @@ +module github.com/michael1011/lightningtip + +require ( + github.com/donovanhide/eventsource v0.0.0-20171031113327-3ed64d21fb0b + github.com/golang/protobuf v1.2.0 // indirect + github.com/grpc-ecosystem/grpc-gateway v0.0.0-20170724004829-f2862b476edc // indirect + github.com/jessevdk/go-flags v1.4.0 + github.com/lightningnetwork/lnd v0.0.0-20180827212353-73af09a06ae9 + github.com/mattn/go-sqlite3 v1.9.0 + github.com/op/go-logging v0.0.0-20160211212156-b2cb9fa56473 + github.com/urfave/cli v1.20.0 + golang.org/x/net v0.0.0-20180311174755-ae89d30ce0c6 // indirect + golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 // indirect + golang.org/x/text v0.3.0 // indirect + google.golang.org/genproto v0.0.0-20180306020942-df60624c1e9b // indirect + google.golang.org/grpc v1.5.2 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..329c781 --- /dev/null +++ b/go.sum @@ -0,0 +1,26 @@ +github.com/donovanhide/eventsource v0.0.0-20171031113327-3ed64d21fb0b h1:eR1P/A4QMYF2/LpHRhYAts9wyYEtF7qNk/tVNiYCWc8= +github.com/donovanhide/eventsource v0.0.0-20171031113327-3ed64d21fb0b/go.mod h1:56wL82FO0bfMU5RvfXoIwSOP2ggqqxT+tAfNEIyxuHw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/grpc-ecosystem/grpc-gateway v0.0.0-20170724004829-f2862b476edc h1:3NXdOHZ1YlN6SGP3FPbn4k73O2MeEp065abehRwGFxI= +github.com/grpc-ecosystem/grpc-gateway v0.0.0-20170724004829-f2862b476edc/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= +github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/lightningnetwork/lnd v0.0.0-20180827212353-73af09a06ae9 h1:6MKdvuQgZ4UOVJ1h9xeASz8oSUySybblkgjQq4Ebu+w= +github.com/lightningnetwork/lnd v0.0.0-20180827212353-73af09a06ae9/go.mod h1:wpCSmoRQxoM/vXLtTETeBp08XnB/9/f+sjPvCJZPyA0= +github.com/mattn/go-sqlite3 v1.9.0 h1:pDRiWfl+++eC2FEFRy6jXmQlvp4Yh3z1MJKg4UeYM/4= +github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/op/go-logging v0.0.0-20160211212156-b2cb9fa56473 h1:J1QZwDXgZ4dJD2s19iqR9+U00OWM2kDzbf1O/fmvCWg= +github.com/op/go-logging v0.0.0-20160211212156-b2cb9fa56473/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= +github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw= +github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +golang.org/x/net v0.0.0-20180311174755-ae89d30ce0c6 h1:VNwI0l6D6+cM79+3XBbvypTLyFJtQP1GEgUNsEadLdY= +golang.org/x/net v0.0.0-20180311174755-ae89d30ce0c6/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/genproto v0.0.0-20180306020942-df60624c1e9b h1:XeiFoG4FHSBJUL3qKCkMrkwBFRXB+hyQiTPg82JUssI= +google.golang.org/genproto v0.0.0-20180306020942-df60624c1e9b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/grpc v1.5.2 h1:b6oAqMSH36Omv3KU5KuN6qB2jaJClahvIWSmfQtfyFw= +google.golang.org/grpc v1.5.2/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=