From 79d58380772582087937ffa53eb670ee913f1f4e Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Tue, 6 Sep 2016 00:44:13 -0400 Subject: [PATCH 1/4] *: fix mispellings --- bittorrent/params_test.go | 2 +- stopper/stopper.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bittorrent/params_test.go b/bittorrent/params_test.go index 36d0819..86da163 100644 --- a/bittorrent/params_test.go +++ b/bittorrent/params_test.go @@ -62,7 +62,7 @@ func TestParseValidURLData(t *testing.T) { } if !mapArrayEqual(parseVal, parsedQueryObj.params) { - t.Fatalf("Incorrect parse at item %d.\n Expected=%v\n Recieved=%v\n", parseIndex, parseVal, parsedQueryObj.params) + t.Fatalf("Incorrect parse at item %d.\n Expected=%v\n Received=%v\n", parseIndex, parseVal, parsedQueryObj.params) } if parsedQueryObj.path != "/announce" { diff --git a/stopper/stopper.go b/stopper/stopper.go index 2b9bd34..5075636 100644 --- a/stopper/stopper.go +++ b/stopper/stopper.go @@ -24,7 +24,7 @@ type Stopper interface { // The channel can either return one error or be closed. Closing the // channel signals a clean shutdown. // The Stop function should return immediately and perform the actual - // shutdown in a seperate goroutine. + // shutdown in a separate goroutine. Stop() <-chan error } From 4f33000d7ea1ede7be591e945b1e9f58456c6401 Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Tue, 6 Sep 2016 00:44:33 -0400 Subject: [PATCH 2/4] stopper: embed lock --- stopper/stopper.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/stopper/stopper.go b/stopper/stopper.go index 5075636..5a6948a 100644 --- a/stopper/stopper.go +++ b/stopper/stopper.go @@ -30,8 +30,8 @@ type Stopper interface { // StopGroup is a group that can be stopped. type StopGroup struct { - stoppables []Func - stoppablesLock sync.Mutex + stoppables []Func + sync.Mutex } // Func is a function that can be used to provide a clean shutdown. @@ -47,8 +47,8 @@ func NewStopGroup() *StopGroup { // Add adds a Stopper to the StopGroup. // On the next call to Stop(), the Stopper will be stopped. func (cg *StopGroup) Add(toAdd Stopper) { - cg.stoppablesLock.Lock() - defer cg.stoppablesLock.Unlock() + cg.Lock() + defer cg.Unlock() cg.stoppables = append(cg.stoppables, toAdd.Stop) } @@ -56,8 +56,8 @@ func (cg *StopGroup) Add(toAdd Stopper) { // AddFunc adds a Func to the StopGroup. // On the next call to Stop(), the Func will be called. func (cg *StopGroup) AddFunc(toAddFunc Func) { - cg.stoppablesLock.Lock() - defer cg.stoppablesLock.Unlock() + cg.Lock() + defer cg.Unlock() cg.stoppables = append(cg.stoppables, toAddFunc) } @@ -67,8 +67,8 @@ func (cg *StopGroup) AddFunc(toAddFunc Func) { // The slice of errors returned contains all errors returned by stopping the // members. func (cg *StopGroup) Stop() []error { - cg.stoppablesLock.Lock() - defer cg.stoppablesLock.Unlock() + cg.Lock() + defer cg.Unlock() var errors []error whenDone := make(chan struct{}) From 210b4d40e5a8a7b4c09c457bc609bdc21111925e Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Tue, 6 Sep 2016 00:46:23 -0400 Subject: [PATCH 3/4] readme: add goreportcard badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5bda1c2..276dedf 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Build Status](https://api.travis-ci.org/chihaya/chihaya.svg?branch=master)](https://travis-ci.org/chihaya/chihaya) [![Docker Repository on Quay.io](https://quay.io/repository/jzelinskie/chihaya/status "Docker Repository on Quay.io")](https://quay.io/repository/jzelinskie/chihaya) +[![Go Report Card](https://goreportcard.com/badge/github.com/chihaya/chihaya)](https://goreportcard.com/report/github.com/chihaya/chihaya) [![GoDoc](https://godoc.org/github.com/chihaya/chihaya?status.svg)](https://godoc.org/github.com/chihaya/chihaya) [![License](https://img.shields.io/badge/license-BSD-blue.svg)](https://en.wikipedia.org/wiki/BSD_licenses#2-clause_license_.28.22Simplified_BSD_License.22_or_.22FreeBSD_License.22.29) [![IRC Channel](https://img.shields.io/badge/freenode-%23chihaya-blue.svg "IRC Channel")](http://webchat.freenode.net/?channels=chihaya) From 625b3721091e11fbaa0fa26dce01051c124a7c4d Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Tue, 6 Sep 2016 00:47:44 -0400 Subject: [PATCH 4/4] *: remove contributors file git sufficiently tracks this --- CONTRIBUTORS | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 CONTRIBUTORS diff --git a/CONTRIBUTORS b/CONTRIBUTORS deleted file mode 100644 index 4e4f530..0000000 --- a/CONTRIBUTORS +++ /dev/null @@ -1,6 +0,0 @@ -# This is the official list of Chihaya contributors, in alphabetical order. - -Jimmy Zelinskie -Josh de Kock -Justin Li -Leo Balduf