From d7998633053c8f3c28f5167e44aa6720eab4995e Mon Sep 17 00:00:00 2001 From: Matt Day Date: Thu, 20 Aug 2015 04:27:40 -0600 Subject: [PATCH 1/4] Specify recursive `go get` Fixes #129. Tells `go get` to fetch the packages needed by cmd/ssh-chat/... --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 23d0f4d..c0bec30 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ Help Options: -h, --help Show this help message ``` -After doing `go get github.com/shazow/ssh-chat` on this repo, you should be able +After doing `go get github.com/shazow/ssh-chat/...` on this repo, you should be able to run a command like: ``` From 0ab31046c0cd8a48376465fed844b509d1f7bd1c Mon Sep 17 00:00:00 2001 From: Matt Day Date: Thu, 20 Aug 2015 04:28:52 -0600 Subject: [PATCH 2/4] Fix `go vet` nitpicks. Fixes #130: * pass by reference into AllowAnonymous * check return value of From() rather than value of From function --- auth.go | 2 +- chat/command.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/auth.go b/auth.go index e8f9192..4d27ca4 100644 --- a/auth.go +++ b/auth.go @@ -54,7 +54,7 @@ func NewAuth() *Auth { } // AllowAnonymous determines if anonymous users are permitted. -func (a Auth) AllowAnonymous() bool { +func (a *Auth) AllowAnonymous() bool { return a.whitelist.Len() == 0 } diff --git a/chat/command.go b/chat/command.go index 76e4b21..61b7073 100644 --- a/chat/command.go +++ b/chat/command.go @@ -62,7 +62,7 @@ func (c Commands) Alias(command string, alias string) error { // Run executes a command message. func (c Commands) Run(room *Room, msg message.CommandMsg) error { - if msg.From == nil { + if msg.From() == nil { return ErrNoOwner } From ebd08408d16d287184c508ddef86a5b6c18ede0e Mon Sep 17 00:00:00 2001 From: Matt Day Date: Thu, 20 Aug 2015 04:42:29 -0600 Subject: [PATCH 3/4] `make deps` should be recursive That way it gets the packages needed by `cmd/ssh-chat/...` --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4ac1400..3d6586c 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ $(BINARY): **/**/*.go **/*.go *.go go build -ldflags "-X main.buildCommit `git describe --long --tags --dirty --always`" ./cmd/ssh-chat deps: - go get . + go get ./... build: $(BINARY) From 6af6d4d23acdd3af7f93d8e64f26e64954c8a443 Mon Sep 17 00:00:00 2001 From: Matt Day Date: Thu, 20 Aug 2015 06:04:06 -0600 Subject: [PATCH 4/4] Have $(BINARY) depend on the `deps` target This fixes `make build` on systems that haven't downloaded the dependencies yet. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3d6586c..699badf 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ SRCS = %.go all: $(BINARY) -$(BINARY): **/**/*.go **/*.go *.go +$(BINARY): deps **/**/*.go **/*.go *.go go build -ldflags "-X main.buildCommit `git describe --long --tags --dirty --always`" ./cmd/ssh-chat deps: