diff --git a/.travis.yml b/.travis.yml index 24edf22..382b01c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,4 +5,12 @@ go: - 1.3 - 1.4 - 1.5 + - 1.6 - tip + +install: + - ./script/bootstrap + +script: + - ./script/test + - ./script/lint diff --git a/CONTRIBUTING.mkd b/CONTRIBUTING.mkd new file mode 100644 index 0000000..0339bec --- /dev/null +++ b/CONTRIBUTING.mkd @@ -0,0 +1,10 @@ +# Contributing + +* Raise an issue if appropriate +* Fork the repo +* Bootstrap the dev dependencies (run `./script/bootstrap`) +* Make your changes +* Use [gofmt](https://golang.org/cmd/gofmt/) +* Make sure the tests pass (run `./script/test`) +* Make sure the linters pass (run `./script/lint`) +* Issue a pull request diff --git a/LICENSE b/LICENSE index 07e245c..55192df 100644 --- a/LICENSE +++ b/LICENSE @@ -1,12 +1,21 @@ -Copyright (c) 2015 Tom Hudson +MIT License -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +Copyright (c) 2016 Tom Hudson -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/main_test.go b/main_test.go index 21e05fc..a9ff359 100644 --- a/main_test.go +++ b/main_test.go @@ -59,7 +59,7 @@ func TestLinkMethods(t *testing.T) { t.Errorf("Link should have param pet=\"cat\"") } - val, err = link.Param("foo") + _, err = link.Param("foo") if err == nil { t.Errorf("Error value should not be nil") } diff --git a/script/bootstrap b/script/bootstrap new file mode 100755 index 0000000..1fff31f --- /dev/null +++ b/script/bootstrap @@ -0,0 +1,6 @@ +#!/bin/sh +PROJDIR=$(cd `dirname $0`/.. && pwd) + +echo "Installing gometalinter and linters..." +go get github.com/alecthomas/gometalinter +gometalinter --install diff --git a/script/lint b/script/lint new file mode 100755 index 0000000..82bd64c --- /dev/null +++ b/script/lint @@ -0,0 +1,4 @@ +#!/bin/sh +PROJDIR=$(cd `dirname $0`/.. && pwd) + +cd ${PROJDIR} && gometalinter diff --git a/script/test b/script/test new file mode 100755 index 0000000..01b91fd --- /dev/null +++ b/script/test @@ -0,0 +1,3 @@ +#!/bin/sh +PROJDIR=$(cd `dirname $0`/.. && pwd) +cd $PROJDIR && go test