Skip to content

Commit

Permalink
added Travis
Browse files Browse the repository at this point in the history
  • Loading branch information
michael1011 committed Sep 1, 2018
1 parent 1b00011 commit 919878d
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 12 deletions.
9 changes: 9 additions & 0 deletions .travis.yml
@@ -0,0 +1,9 @@
language: go

go:
- "1.10"

script:
- make dep
- make build
- make lint
2 changes: 1 addition & 1 deletion Gopkg.toml
Expand Up @@ -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"
Expand Down
21 changes: 12 additions & 9 deletions Makefile
Expand Up @@ -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}}' ./...)

Expand All @@ -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
Expand All @@ -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))"
10 changes: 8 additions & 2 deletions lightningtip.go
Expand Up @@ -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
Expand Down

0 comments on commit 919878d

Please sign in to comment.