From 9098638f4dab6acadcbbe8b0c6ae428fe9a93af9 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Thu, 24 Dec 2015 12:47:47 +0100 Subject: [PATCH 1/5] Added pkg.re usage --- .travis.yml | 2 +- .travis/script.sh | 22 ++++++++++++++++++++++ arg/arg.go | 2 +- arg/arg_test.go | 3 ++- cron/cron_test.go | 2 +- crypto/crypto_test.go | 2 +- crypto/passwd.go | 2 +- csv/csv_test.go | 2 +- easing/ease_test.go | 2 +- errutil/errutil_test.go | 3 ++- fmtc/fmtc_test.go | 2 +- fmtutil/fmtutil.go | 2 +- fmtutil/fmtutil_test.go | 2 +- fmtutil/separator.go | 2 +- fmtutil/termsize_linux_test.go | 2 +- fsutil/fs.go | 2 +- fsutil/fs_test.go | 3 ++- httputil/httputil_test.go | 2 +- jsonutil/jsonutil_test.go | 5 +++-- knf/knf.go | 2 +- knf/knf_test.go | 2 +- log/log_test.go | 4 ++-- mathutil/mathutil_test.go | 3 ++- pid/pid.go | 2 +- pid/pid_test.go | 4 ++-- rand/rand_test.go | 2 +- req/req_test.go | 4 ++-- sliceutil/sliceutil_test.go | 2 +- sortutil/sortutil_test.go | 3 ++- spellcheck/spellcheck.go | 2 +- spellcheck/spellcheck_test.go | 3 ++- strutil/strutil_test.go | 2 +- terminal/terminal.go | 4 ++-- timeutil/timeutil.go | 2 +- timeutil/timeutil_test.go | 3 ++- tmp/tmp.go | 4 ++-- tmp/tmp_test.go | 5 +++-- usage/usage.go | 2 +- version/version_test.go | 2 +- 39 files changed, 76 insertions(+), 45 deletions(-) diff --git a/.travis.yml b/.travis.yml index f51c2d8e..135cc976 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ env: - EK_TEST_PORT=8080 before_install: - - go get gopkg.in/check.v1 + - go get pkg.re/check.v1 script: - .travis/script.sh . diff --git a/.travis/script.sh b/.travis/script.sh index ce7e91ae..7575fe2e 100755 --- a/.travis/script.sh +++ b/.travis/script.sh @@ -2,6 +2,10 @@ ######################################################################################## +# Main func +# +# *: All arguments passed to script +# main() { local dir="$1" @@ -9,6 +13,24 @@ main() { exit 1 fi + makeLink + testWithCover "$dir" +} + +# Create links for pkg.re import paths +# +makeLink() { + mkdir -p $GOPATH/src/pkg.re/essentialkaos + ln -sf $GOPATH/src/pkg.re/essentialkaos/ek.v1 $GOPATH/src/github.com/essentialkaos/ek +} + +# Test packaages and save coverage info to file +# +# 1: Dir with sources (String) +# +testWithCover() { + local dir="$1" + local pkg has_errors rm -f coverage.tmp coverage.txt &> /dev/null diff --git a/arg/arg.go b/arg/arg.go index 1580c6bd..26113273 100644 --- a/arg/arg.go +++ b/arg/arg.go @@ -14,7 +14,7 @@ import ( "strconv" "strings" - "github.com/essentialkaos/ek/mathutil" + "pkg.re/essentialkaos/ek.v1/mathutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/arg/arg_test.go b/arg/arg_test.go index f15c52bc..6dc30c89 100644 --- a/arg/arg_test.go +++ b/arg/arg_test.go @@ -8,9 +8,10 @@ package arg // ////////////////////////////////////////////////////////////////////////////////// // import ( - . "gopkg.in/check.v1" "strings" "testing" + + . "pkg.re/check.v1" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/cron/cron_test.go b/cron/cron_test.go index 3832ff40..d6181449 100644 --- a/cron/cron_test.go +++ b/cron/cron_test.go @@ -11,7 +11,7 @@ import ( "testing" "time" - . "gopkg.in/check.v1" + . "pkg.re/check.v1" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/crypto/crypto_test.go b/crypto/crypto_test.go index b2544ffb..7c851541 100644 --- a/crypto/crypto_test.go +++ b/crypto/crypto_test.go @@ -11,7 +11,7 @@ import ( "io/ioutil" "testing" - . "gopkg.in/check.v1" + . "pkg.re/check.v1" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/crypto/passwd.go b/crypto/passwd.go index a351ed3d..2278c1d9 100644 --- a/crypto/passwd.go +++ b/crypto/passwd.go @@ -15,7 +15,7 @@ import ( "strings" "time" - "github.com/essentialkaos/ek/mathutil" + "pkg.re/essentialkaos/ek.v1/mathutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/csv/csv_test.go b/csv/csv_test.go index 6db3df87..06e65fa7 100644 --- a/csv/csv_test.go +++ b/csv/csv_test.go @@ -13,7 +13,7 @@ import ( "os" "testing" - . "gopkg.in/check.v1" + . "pkg.re/check.v1" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/easing/ease_test.go b/easing/ease_test.go index 021cf22e..34c8a16f 100644 --- a/easing/ease_test.go +++ b/easing/ease_test.go @@ -10,7 +10,7 @@ package easing import ( "testing" - . "gopkg.in/check.v1" + . "pkg.re/check.v1" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/errutil/errutil_test.go b/errutil/errutil_test.go index 973d43ce..6d38e6ca 100644 --- a/errutil/errutil_test.go +++ b/errutil/errutil_test.go @@ -9,8 +9,9 @@ package errutil import ( "errors" - . "gopkg.in/check.v1" "testing" + + . "pkg.re/check.v1" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/fmtc/fmtc_test.go b/fmtc/fmtc_test.go index 8f6f11c8..d46868c0 100644 --- a/fmtc/fmtc_test.go +++ b/fmtc/fmtc_test.go @@ -12,7 +12,7 @@ import ( "errors" "testing" - . "gopkg.in/check.v1" + . "pkg.re/check.v1" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/fmtutil/fmtutil.go b/fmtutil/fmtutil.go index 1c2354a6..0cff43c3 100644 --- a/fmtutil/fmtutil.go +++ b/fmtutil/fmtutil.go @@ -13,7 +13,7 @@ import ( "strconv" "strings" - "github.com/essentialkaos/ek/mathutil" + "pkg.re/essentialkaos/ek.v1/mathutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/fmtutil/fmtutil_test.go b/fmtutil/fmtutil_test.go index 90287b63..72ca4602 100644 --- a/fmtutil/fmtutil_test.go +++ b/fmtutil/fmtutil_test.go @@ -10,7 +10,7 @@ package fmtutil import ( "testing" - . "gopkg.in/check.v1" + . "pkg.re/check.v1" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/fmtutil/separator.go b/fmtutil/separator.go index c39cb265..8d1f0b3a 100644 --- a/fmtutil/separator.go +++ b/fmtutil/separator.go @@ -8,7 +8,7 @@ package fmtutil // ////////////////////////////////////////////////////////////////////////////////// // import ( - "github.com/essentialkaos/ek/fmtc" + "pkg.re/essentialkaos/ek.v1/fmtc" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/fmtutil/termsize_linux_test.go b/fmtutil/termsize_linux_test.go index 9edb5071..40f4515d 100644 --- a/fmtutil/termsize_linux_test.go +++ b/fmtutil/termsize_linux_test.go @@ -10,7 +10,7 @@ package fmtutil // ////////////////////////////////////////////////////////////////////////////////// // import ( - . "gopkg.in/check.v1" + . "pkg.re/check.v1" ) // //////////////////////////////////////////////////// diff --git a/fsutil/fs.go b/fsutil/fs.go index 337b19ba..22d90593 100644 --- a/fsutil/fs.go +++ b/fsutil/fs.go @@ -17,7 +17,7 @@ import ( "syscall" "time" - "github.com/essentialkaos/ek/system" + "pkg.re/essentialkaos/ek.v1/system" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/fsutil/fs_test.go b/fsutil/fs_test.go index 5ec01e38..1f8a6eb2 100644 --- a/fsutil/fs_test.go +++ b/fsutil/fs_test.go @@ -8,10 +8,11 @@ package fsutil // ////////////////////////////////////////////////////////////////////////////////// // import ( - check "gopkg.in/check.v1" "os" "sort" "testing" + + check "pkg.re/check.v1" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/httputil/httputil_test.go b/httputil/httputil_test.go index e90a2fd7..fb1ba130 100644 --- a/httputil/httputil_test.go +++ b/httputil/httputil_test.go @@ -11,7 +11,7 @@ import ( "net/http" "testing" - . "gopkg.in/check.v1" + . "pkg.re/check.v1" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/jsonutil/jsonutil_test.go b/jsonutil/jsonutil_test.go index 0158299a..a83af93f 100644 --- a/jsonutil/jsonutil_test.go +++ b/jsonutil/jsonutil_test.go @@ -8,11 +8,12 @@ package jsonutil // ////////////////////////////////////////////////////////////////////////////////// // import ( - . "gopkg.in/check.v1" "io/ioutil" "testing" - "github.com/essentialkaos/ek/crypto" + . "pkg.re/check.v1" + + "pkg.re/essentialkaos/ek.v1/crypto" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/knf/knf.go b/knf/knf.go index 16f95129..f9f52324 100644 --- a/knf/knf.go +++ b/knf/knf.go @@ -17,7 +17,7 @@ import ( "strconv" "strings" - "github.com/essentialkaos/ek/fsutil" + "pkg.re/essentialkaos/ek.v1/fsutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/knf/knf_test.go b/knf/knf_test.go index 49f6c085..9e4f8675 100644 --- a/knf/knf_test.go +++ b/knf/knf_test.go @@ -13,7 +13,7 @@ import ( "os" "testing" - check "gopkg.in/check.v1" + check "pkg.re/check.v1" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/log/log_test.go b/log/log_test.go index 7e9eeb5b..3f487d77 100644 --- a/log/log_test.go +++ b/log/log_test.go @@ -14,9 +14,9 @@ import ( "testing" "time" - . "gopkg.in/check.v1" + . "pkg.re/check.v1" - "github.com/essentialkaos/ek/fsutil" + "pkg.re/essentialkaos/ek.v1/fsutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/mathutil/mathutil_test.go b/mathutil/mathutil_test.go index cbfc49ca..71ebd567 100644 --- a/mathutil/mathutil_test.go +++ b/mathutil/mathutil_test.go @@ -8,8 +8,9 @@ package mathutil // ////////////////////////////////////////////////////////////////////////////////// // import ( - . "gopkg.in/check.v1" "testing" + + . "pkg.re/check.v1" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/pid/pid.go b/pid/pid.go index 2497f8f8..32c4de90 100644 --- a/pid/pid.go +++ b/pid/pid.go @@ -16,7 +16,7 @@ import ( "strconv" "strings" - "github.com/essentialkaos/ek/fsutil" + "pkg.re/essentialkaos/ek.v1/fsutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/pid/pid_test.go b/pid/pid_test.go index f9cb7106..64d97dc8 100644 --- a/pid/pid_test.go +++ b/pid/pid_test.go @@ -13,9 +13,9 @@ import ( "os" "testing" - . "gopkg.in/check.v1" + . "pkg.re/check.v1" - "github.com/essentialkaos/ek/fsutil" + "pkg.re/essentialkaos/ek.v1/fsutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/rand/rand_test.go b/rand/rand_test.go index da18dcb3..dcfc2ade 100644 --- a/rand/rand_test.go +++ b/rand/rand_test.go @@ -11,7 +11,7 @@ import ( "strings" "testing" - . "gopkg.in/check.v1" + . "pkg.re/check.v1" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/req/req_test.go b/req/req_test.go index afa725b6..81284ce2 100644 --- a/req/req_test.go +++ b/req/req_test.go @@ -14,9 +14,9 @@ import ( "testing" "time" - "github.com/essentialkaos/ek/env" + . "pkg.re/check.v1" - . "gopkg.in/check.v1" + "pkg.re/essentialkaos/ek.v1/env" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/sliceutil/sliceutil_test.go b/sliceutil/sliceutil_test.go index 3c8677eb..60560dac 100644 --- a/sliceutil/sliceutil_test.go +++ b/sliceutil/sliceutil_test.go @@ -11,7 +11,7 @@ import ( "errors" "testing" - . "gopkg.in/check.v1" + . "pkg.re/check.v1" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/sortutil/sortutil_test.go b/sortutil/sortutil_test.go index da9c081d..0645f37b 100644 --- a/sortutil/sortutil_test.go +++ b/sortutil/sortutil_test.go @@ -8,8 +8,9 @@ package sortutil // ////////////////////////////////////////////////////////////////////////////////// // import ( - . "gopkg.in/check.v1" "testing" + + . "pkg.re/check.v1" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/spellcheck/spellcheck.go b/spellcheck/spellcheck.go index e979ba2c..d19efa70 100644 --- a/spellcheck/spellcheck.go +++ b/spellcheck/spellcheck.go @@ -12,7 +12,7 @@ import ( "sort" "strings" - "github.com/essentialkaos/ek/mathutil" + "pkg.re/essentialkaos/ek.v1/mathutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/spellcheck/spellcheck_test.go b/spellcheck/spellcheck_test.go index b98beff6..321b0b70 100644 --- a/spellcheck/spellcheck_test.go +++ b/spellcheck/spellcheck_test.go @@ -8,8 +8,9 @@ package spellcheck // ////////////////////////////////////////////////////////////////////////////////// // import ( - . "gopkg.in/check.v1" "testing" + + . "pkg.re/check.v1" ) func Test(t *testing.T) { TestingT(t) } diff --git a/strutil/strutil_test.go b/strutil/strutil_test.go index 3a4ba771..0e5450ec 100644 --- a/strutil/strutil_test.go +++ b/strutil/strutil_test.go @@ -10,7 +10,7 @@ package strutil import ( "testing" - . "gopkg.in/check.v1" + . "pkg.re/check.v1" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/terminal/terminal.go b/terminal/terminal.go index c64526b7..9e2a8daf 100644 --- a/terminal/terminal.go +++ b/terminal/terminal.go @@ -14,8 +14,8 @@ import ( "fmt" "strings" - "github.com/essentialkaos/ek/fmtc" - "github.com/essentialkaos/go.linenoise" + "pkg.re/GeertJohan/go.linenoise" + "pkg.re/essentialkaos/ek.v1/fmtc" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/timeutil/timeutil.go b/timeutil/timeutil.go index 1573d3e5..7f8056cf 100644 --- a/timeutil/timeutil.go +++ b/timeutil/timeutil.go @@ -15,7 +15,7 @@ import ( "strings" "time" - "github.com/essentialkaos/ek/fmtutil" + "pkg.re/essentialkaos/ek.v1/fmtutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/timeutil/timeutil_test.go b/timeutil/timeutil_test.go index 03791f62..8297bdd8 100644 --- a/timeutil/timeutil_test.go +++ b/timeutil/timeutil_test.go @@ -9,9 +9,10 @@ package timeutil import ( "bytes" - . "gopkg.in/check.v1" "testing" "time" + + . "pkg.re/check.v1" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/tmp/tmp.go b/tmp/tmp.go index 29d3d8ff..5ef20c56 100644 --- a/tmp/tmp.go +++ b/tmp/tmp.go @@ -12,8 +12,8 @@ import ( "os" "path" - "github.com/essentialkaos/ek/fsutil" - "github.com/essentialkaos/ek/rand" + "pkg.re/essentialkaos/ek.v1/fsutil" + "pkg.re/essentialkaos/ek.v1/rand" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/tmp/tmp_test.go b/tmp/tmp_test.go index f611d3ea..619bff8f 100644 --- a/tmp/tmp_test.go +++ b/tmp/tmp_test.go @@ -8,11 +8,12 @@ package tmp // ////////////////////////////////////////////////////////////////////////////////// // import ( - . "gopkg.in/check.v1" "os" "testing" - "github.com/essentialkaos/ek/fsutil" + . "pkg.re/check.v1" + + "pkg.re/essentialkaos/ek.v1/fsutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/usage/usage.go b/usage/usage.go index 3ae2f81c..6ec86e3d 100644 --- a/usage/usage.go +++ b/usage/usage.go @@ -15,7 +15,7 @@ import ( "strings" "time" - "github.com/essentialkaos/ek/fmtc" + "pkg.re/essentialkaos/ek.v1/fmtc" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/version/version_test.go b/version/version_test.go index 94c055fd..752bdc35 100644 --- a/version/version_test.go +++ b/version/version_test.go @@ -10,7 +10,7 @@ package version import ( "testing" - . "gopkg.in/check.v1" + . "pkg.re/check.v1" ) // ////////////////////////////////////////////////////////////////////////////////// // From 66893b9b5d9afe197146185cce6bc5f6ad3a24ba Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Thu, 24 Dec 2015 12:50:12 +0100 Subject: [PATCH 2/5] Fixed import path for go.linenoise --- terminal/terminal.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/terminal/terminal.go b/terminal/terminal.go index 9e2a8daf..603b09d0 100644 --- a/terminal/terminal.go +++ b/terminal/terminal.go @@ -14,7 +14,8 @@ import ( "fmt" "strings" - "pkg.re/GeertJohan/go.linenoise" + "github.com/GeertJohan/go.linenoise" + "pkg.re/essentialkaos/ek.v1/fmtc" ) From dd26874122bc5154fa66df4b1c397ac763d5dc3a Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Thu, 24 Dec 2015 12:53:10 +0100 Subject: [PATCH 3/5] Improved TravisCI test script --- .travis/script.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.travis/script.sh b/.travis/script.sh index 7575fe2e..cb9727b0 100755 --- a/.travis/script.sh +++ b/.travis/script.sh @@ -20,6 +20,12 @@ main() { # Create links for pkg.re import paths # makeLink() { + # TravicCI download last stable version of ek, but it not ok + # remove downloaded version for linking with current version for test + if [[ -d $GOPATH/src/pkg.re/essentialkaos/ek.v1 ]] ; then + rm -rf $GOPATH/src/pkg.re/essentialkaos/ek.v1 + fi + mkdir -p $GOPATH/src/pkg.re/essentialkaos ln -sf $GOPATH/src/pkg.re/essentialkaos/ek.v1 $GOPATH/src/github.com/essentialkaos/ek } From 278cc10c719a9cdbedcd0b651902e169d4466741 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Thu, 24 Dec 2015 12:55:49 +0100 Subject: [PATCH 4/5] Improved TravisCI test script --- .travis/script.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.travis/script.sh b/.travis/script.sh index cb9727b0..bbc33fe5 100755 --- a/.travis/script.sh +++ b/.travis/script.sh @@ -22,12 +22,15 @@ main() { makeLink() { # TravicCI download last stable version of ek, but it not ok # remove downloaded version for linking with current version for test - if [[ -d $GOPATH/src/pkg.re/essentialkaos/ek.v1 ]] ; then + if [[ -e $GOPATH/src/pkg.re/essentialkaos/ek.v1 ]] ; then + echo "Directory pkg.re/essentialkaos/ek.v1 removed" rm -rf $GOPATH/src/pkg.re/essentialkaos/ek.v1 fi mkdir -p $GOPATH/src/pkg.re/essentialkaos - ln -sf $GOPATH/src/pkg.re/essentialkaos/ek.v1 $GOPATH/src/github.com/essentialkaos/ek + + echo "Created link $GOPATH/src/pkg.re/essentialkaos/ek.v1 -> $GOPATH/src/github.com/essentialkaos/ek" + ln -sf $GOPATH/src/github.com/essentialkaos/ek $GOPATH/src/pkg.re/essentialkaos/ek.v1 } # Test packaages and save coverage info to file From 975c5e186b931b1e807f7b11d96f4b0787c7dc85 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Thu, 24 Dec 2015 12:58:58 +0100 Subject: [PATCH 5/5] Changed install command in readme file --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 9775e3eb..df8b19d2 100644 --- a/readme.md +++ b/readme.md @@ -9,7 +9,7 @@ Currently we support Linux and Mac OS X. Some packages have stubs for Windows (f ### Installation ```` -go get github.com/essentialkaos/ek +go get pkg.re/essentialkaos/ek.v1 ```` ### Packages