From d539f2df4818dfc38c211d11e1e92896a89d5e35 Mon Sep 17 00:00:00 2001 From: Atrox Date: Fri, 12 Oct 2018 14:23:00 +0200 Subject: [PATCH 1/5] add support for go modules --- go.mod | 24 ++++++++++++++++++++++++ go.sum | 45 +++++++++++++++++++++++++++++++++++++++++++++ hermes.go | 2 +- 3 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 go.mod create mode 100644 go.sum diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..2c61de2 --- /dev/null +++ b/go.mod @@ -0,0 +1,24 @@ +module github.com/matcornic/hermes + +require ( + github.com/Masterminds/semver v1.4.2 // indirect + github.com/Masterminds/sprig v2.16.0+incompatible + github.com/aokoli/goutils v1.0.1 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/google/uuid v1.0.0 // indirect + github.com/huandu/xstrings v1.2.0 // indirect + github.com/imdario/mergo v0.3.6 + github.com/jaytaylor/html2text v0.0.0-20180606194806-57d518f124b0 + github.com/kr/pretty v0.1.0 // indirect + github.com/mattn/go-runewidth v0.0.3 // indirect + github.com/olekukonko/tablewriter v0.0.0-20180912035003-be2c049b30cc // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/russross/blackfriday v2.0.0+incompatible + github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95 // indirect + github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf // indirect + github.com/stretchr/testify v1.2.2 + golang.org/x/crypto v0.0.0-20181009213950-7c1a557ab941 // indirect + golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1 // indirect + gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect + gopkg.in/yaml.v2 v2.2.1 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..bdad481 --- /dev/null +++ b/go.sum @@ -0,0 +1,45 @@ +github.com/Masterminds/semver v1.4.2 h1:WBLTQ37jOCzSLtXNdoo8bNM8876KhNqOKvrlGITgsTc= +github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= +github.com/Masterminds/sprig v2.16.0+incompatible h1:QZbMUPxRQ50EKAq3LFMnxddMu88/EUUG3qmxwtDmPsY= +github.com/Masterminds/sprig v2.16.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= +github.com/aokoli/goutils v1.0.1 h1:7fpzNGoJ3VA8qcrm++XEE1QUe0mIwNeLa02Nwq7RDkg= +github.com/aokoli/goutils v1.0.1/go.mod h1:SijmP0QR8LtwsmDs8Yii5Z/S4trXFGFC2oO5g9DP+DQ= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/google/uuid v1.0.0 h1:b4Gk+7WdP/d3HZH8EJsZpvV7EtDOgaZLtnaNGIu1adA= +github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/huandu/xstrings v1.2.0 h1:yPeWdRnmynF7p+lLYz0H2tthW9lqhMJrQV/U7yy4wX0= +github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4= +github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28= +github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/jaytaylor/html2text v0.0.0-20180606194806-57d518f124b0 h1:xqgexXAGQgY3HAjNPSaCqn5Aahbo5TKsmhp8VRfr1iQ= +github.com/jaytaylor/html2text v0.0.0-20180606194806-57d518f124b0/go.mod h1:CVKlgaMiht+LXvHG173ujK6JUhZXKb2u/BQtjPDIvyk= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/mattn/go-runewidth v0.0.3 h1:a+kO+98RDGEfo6asOGMmpodZq4FNtnGP54yps8BzLR4= +github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/olekukonko/tablewriter v0.0.0-20180912035003-be2c049b30cc h1:rQ1O4ZLYR2xXHXgBCCfIIGnuZ0lidMQw2S5n1oOv+Wg= +github.com/olekukonko/tablewriter v0.0.0-20180912035003-be2c049b30cc/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/russross/blackfriday v2.0.0+incompatible h1:cBXrhZNUf9C+La9/YpS+UHpUT8YD6Td9ZMSU9APFcsk= +github.com/russross/blackfriday v2.0.0+incompatible/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95 h1:/vdW8Cb7EXrkqWGufVMES1OH2sU9gKVb2n9/1y5NMBY= +github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf h1:pvbZ0lM0XWPBqUKqFU8cmavspvIl9nulOYwdy6IFRRo= +github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf/go.mod h1:RJID2RhlZKId02nZ62WenDCkgHFerpIOmW0iT7GKmXM= +github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +golang.org/x/crypto v0.0.0-20181009213950-7c1a557ab941 h1:qBTHLajHecfu+xzRI9PqVDcqx7SdHj9d4B+EzSn3tAc= +golang.org/x/crypto v0.0.0-20181009213950-7c1a557ab941/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1 h1:Y/KGZSOdz/2r0WJ9Mkmz6NJBusp0kiNx1Cn82lzJQ6w= +golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/hermes.go b/hermes.go index 6848ef4..372bdeb 100644 --- a/hermes.go +++ b/hermes.go @@ -5,7 +5,7 @@ import ( "github.com/Masterminds/sprig" "github.com/imdario/mergo" "github.com/jaytaylor/html2text" - "gopkg.in/russross/blackfriday.v2" + "github.com/russross/blackfriday" "html/template" ) From 417edf736f5c6eb3f85ff712972d226eba1ba08b Mon Sep 17 00:00:00 2001 From: Atrox Date: Fri, 12 Oct 2018 14:27:55 +0200 Subject: [PATCH 2/5] use blackfriday v2 --- go.mod | 2 +- go.sum | 4 ++-- hermes.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 2c61de2..44773a6 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/mattn/go-runewidth v0.0.3 // indirect github.com/olekukonko/tablewriter v0.0.0-20180912035003-be2c049b30cc // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/russross/blackfriday v2.0.0+incompatible + github.com/russross/blackfriday/v2 v2.0.1 github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95 // indirect github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf // indirect github.com/stretchr/testify v1.2.2 diff --git a/go.sum b/go.sum index bdad481..6ca2efc 100644 --- a/go.sum +++ b/go.sum @@ -25,8 +25,8 @@ github.com/olekukonko/tablewriter v0.0.0-20180912035003-be2c049b30cc h1:rQ1O4ZLY github.com/olekukonko/tablewriter v0.0.0-20180912035003-be2c049b30cc/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/russross/blackfriday v2.0.0+incompatible h1:cBXrhZNUf9C+La9/YpS+UHpUT8YD6Td9ZMSU9APFcsk= -github.com/russross/blackfriday v2.0.0+incompatible/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95 h1:/vdW8Cb7EXrkqWGufVMES1OH2sU9gKVb2n9/1y5NMBY= github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf h1:pvbZ0lM0XWPBqUKqFU8cmavspvIl9nulOYwdy6IFRRo= diff --git a/hermes.go b/hermes.go index 372bdeb..825a9dd 100644 --- a/hermes.go +++ b/hermes.go @@ -5,7 +5,7 @@ import ( "github.com/Masterminds/sprig" "github.com/imdario/mergo" "github.com/jaytaylor/html2text" - "github.com/russross/blackfriday" + "github.com/russross/blackfriday/v2" "html/template" ) From f10aa65cb06401047ffde47196f225dd3fae126c Mon Sep 17 00:00:00 2001 From: Atrox Date: Fri, 12 Oct 2018 14:48:08 +0200 Subject: [PATCH 3/5] remove dep --- Gopkg.lock | 111 ----------------------------------------------------- Gopkg.toml | 42 -------------------- 2 files changed, 153 deletions(-) delete mode 100644 Gopkg.lock delete mode 100644 Gopkg.toml diff --git a/Gopkg.lock b/Gopkg.lock deleted file mode 100644 index d9cb890..0000000 --- a/Gopkg.lock +++ /dev/null @@ -1,111 +0,0 @@ -# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. - - -[[projects]] - name = "github.com/Masterminds/semver" - packages = ["."] - revision = "15d8430ab86497c5c0da827b748823945e1cf1e1" - version = "v1.4.0" - -[[projects]] - name = "github.com/Masterminds/sprig" - packages = ["."] - revision = "b217b9c388de2cacde4354c536e520c52c055563" - version = "v2.14.1" - -[[projects]] - name = "github.com/aokoli/goutils" - packages = ["."] - revision = "3391d3790d23d03408670993e957e8f408993c34" - version = "v1.0.1" - -[[projects]] - name = "github.com/davecgh/go-spew" - packages = ["spew"] - revision = "346938d642f2ec3594ed81d874461961cd0faa76" - version = "v1.1.0" - -[[projects]] - branch = "master" - name = "github.com/huandu/xstrings" - packages = ["."] - revision = "37469d0c81a7910b49d64a0d308ded4823e90937" - -[[projects]] - name = "github.com/imdario/mergo" - packages = ["."] - revision = "7fe0c75c13abdee74b09fcacef5ea1c6bba6a874" - version = "0.2.4" - -[[projects]] - branch = "master" - name = "github.com/jaytaylor/html2text" - packages = ["."] - revision = "63248bc9adbcc063665823c90e39eaf58aca7a8b" - -[[projects]] - name = "github.com/mattn/go-runewidth" - packages = ["."] - revision = "9e777a8366cce605130a531d2cd6363d07ad7317" - version = "v0.0.2" - -[[projects]] - branch = "master" - name = "github.com/olekukonko/tablewriter" - packages = ["."] - revision = "65fec0d89a572b4367094e2058d3ebe667de3b60" - -[[projects]] - name = "github.com/pmezard/go-difflib" - packages = ["difflib"] - revision = "792786c7400a136282c1664665ae0a8db921c6c2" - version = "v1.0.0" - -[[projects]] - name = "github.com/satori/go.uuid" - packages = ["."] - revision = "879c5887cd475cd7864858769793b2ceb0d44feb" - version = "v1.1.0" - -[[projects]] - branch = "master" - name = "github.com/shurcooL/sanitized_anchor_name" - packages = ["."] - revision = "86672fcb3f950f35f2e675df2240550f2a50762f" - -[[projects]] - branch = "master" - name = "github.com/ssor/bom" - packages = ["."] - revision = "6386211fdfcf24c0bfbdaceafd02849ed9a8a509" - -[[projects]] - name = "github.com/stretchr/testify" - packages = ["assert"] - revision = "69483b4bd14f5845b5a1e55bca19e954e827f1d0" - version = "v1.1.4" - -[[projects]] - branch = "master" - name = "golang.org/x/crypto" - packages = ["pbkdf2","scrypt"] - revision = "94eea52f7b742c7cbe0b03b22f0c4c8631ece122" - -[[projects]] - branch = "master" - name = "golang.org/x/net" - packages = ["html","html/atom"] - revision = "d866cfc389cec985d6fda2859936a575a55a3ab6" - -[[projects]] - name = "gopkg.in/russross/blackfriday.v2" - packages = ["."] - revision = "cadec560ec52d93835bf2f15bd794700d3a2473b" - version = "v2.0.0" - -[solve-meta] - analyzer-name = "dep" - analyzer-version = 1 - inputs-digest = "74f494e631dfdf63c96d26579f7f802e52dfe70480f1b3cfc03ef331eb223dea" - solver-name = "gps-cdcl" - solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml deleted file mode 100644 index a7ccc7b..0000000 --- a/Gopkg.toml +++ /dev/null @@ -1,42 +0,0 @@ - -# Gopkg.toml example -# -# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md -# for detailed Gopkg.toml documentation. -# -# required = ["github.com/user/thing/cmd/thing"] -# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] -# -# [[constraint]] -# name = "github.com/user/project" -# version = "1.0.0" -# -# [[constraint]] -# name = "github.com/user/project2" -# branch = "dev" -# source = "github.com/myfork/project2" -# -# [[override]] -# name = "github.com/x/y" -# version = "2.4.0" - - -[[constraint]] - name = "github.com/Masterminds/sprig" - version = "2.14.1" - -[[constraint]] - name = "github.com/imdario/mergo" - version = "0.2.4" - -[[constraint]] - branch = "master" - name = "github.com/jaytaylor/html2text" - -[[constraint]] - name = "github.com/stretchr/testify" - version = "1.1.4" - -[[constraint]] - name = "gopkg.in/russross/blackfriday.v2" - version = "2.0.0" From 030205b1cf33917f6a00329619605308e8c2434d Mon Sep 17 00:00:00 2001 From: Atrox Date: Fri, 12 Oct 2018 14:48:27 +0200 Subject: [PATCH 4/5] use golangci instead of gometalinter --- .travis.yml | 15 ++++++--------- gometalinter.json | 17 ----------------- 2 files changed, 6 insertions(+), 26 deletions(-) delete mode 100644 gometalinter.json diff --git a/.travis.yml b/.travis.yml index e0055bd..ffe4b58 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,20 +1,17 @@ language: go go: - - 1.6 - - 1.7 - - 1.8 - - 1.9 + - 1.11 install: -- curl -L https://github.com/golang/dep/releases/download/v0.3.2/dep-linux-amd64 -o dep -- chmod u+x dep && ./dep ensure -- go get -u github.com/alecthomas/gometalinter -- gometalinter -u -i -f +- curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $GOPATH/bin v1.10.2 script: - go test -race -coverprofile=coverage.txt -covermode=atomic -- gometalinter --vendor --config=./gometalinter.json ./... +- golangci-lint run --fast after_success: - bash <(curl -s https://codecov.io/bash) + +env: + - GO111MODULE=on diff --git a/gometalinter.json b/gometalinter.json deleted file mode 100644 index 80d6aaf..0000000 --- a/gometalinter.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "DisableAll": true, - "Enable": [ - "unused", - "vet", - "vetshadow", - "deadcode", - "gofmt", - "golint", - "ineffassign", - "goconst", - "gosimple", - "staticcheck", - "misspell" - ], - "Test": true -} \ No newline at end of file From 9d5eaf364c1b67461ae4431c0b5fa9655f734537 Mon Sep 17 00:00:00 2001 From: Atrox Date: Fri, 12 Oct 2018 15:50:37 +0200 Subject: [PATCH 5/5] add golangci config and remove fast option --- .golangci.yml | 13 +++++++++++++ .travis.yml | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 .golangci.yml diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..fc832e6 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,13 @@ +linters-settings: + lll: + line-length: 150 + +linters: + enable-all: true + +issues: + max-same: 0 # Disable maximum count of issues with the same text. + exclude: + - G104 # Duplicate of errcheck + + exclude-use-default: false diff --git a/.travis.yml b/.travis.yml index ffe4b58..8460ad3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ install: script: - go test -race -coverprofile=coverage.txt -covermode=atomic -- golangci-lint run --fast +- golangci-lint run after_success: - bash <(curl -s https://codecov.io/bash)