diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..61fd161 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,9 @@ +language: go + +go: + - "1.10" + +script: + - make dep + - make build + - make lint diff --git a/Gopkg.toml b/Gopkg.toml index a891c09..208a598 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -12,7 +12,7 @@ [[constraint]] name = "github.com/lightningnetwork/lnd" - version = "0.5.0-beta" + version = "0.5-beta-rc1" [[constraint]] name = "github.com/op/go-logging" diff --git a/Makefile b/Makefile index 13d9771..90689f9 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,15 @@ 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) + +$(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 LINT_LIST = $(go list -f '{{.Dir}}' ./...) @@ -28,14 +37,10 @@ LINT = $(LINT_BIN) $(LINT_LIST) \ grep -v 'ALL_CAPS\|OP_' 2>&1 | \ tee /dev/stderr -default: scratch +default: dep build # Dependencies -$(DEP_BIN): - @$(call print, "Fetching dep") - go get -u github.com/golang/dep/cmd/dep - dep: $(DEP_BIN) @$(call print, "Compiling dependencies") dep ensure -v @@ -52,15 +57,13 @@ install: $(GOINSTALL) $(PKG) $(GOINSTALL) $(PKG)/cmd/tipreport -scratch: dep build - # Utils fmt: - @$(call print, "Formatting source.") + @$(call print, "Formatting source") gofmt -s -w . lint: $(LINT_BIN) - @$(call print, "Linting source.") + @$(call print, "Linting source") $(LINT_BIN) --install 1> /dev/null test -z "$$($(LINT))" diff --git a/lightningtip.go b/lightningtip.go index 5f3a761..06e0251 100644 --- a/lightningtip.go +++ b/lightningtip.go @@ -32,9 +32,15 @@ var eventSrv *eventsource.Server var pendingInvoices []PendingInvoice // To use the pendingInvoice type as event for the EventSource stream -func (pending PendingInvoice) Id() string { return "" } + +// Id gets the ID of the event which is not neede in our scenario +func (pending PendingInvoice) Id() string { return "" } // nolint: golint + +// Event is for using a different type of event than "data" func (pending PendingInvoice) Event() string { return "" } -func (pending PendingInvoice) Data() string { return pending.RHash } + +// Data tells EventSource what data to write +func (pending PendingInvoice) Data() string { return pending.RHash } type invoiceRequest struct { Amount int64