diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a59199..0a851ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## v0.0.13 + +Released on 2020/01/17 + +[release](https://github.com/dyweb/gommon/releases/tag/0.0.13) [closed issues](https://github.com/dyweb/gommon/issues?q=is%3Aclosed+milestone%3A0.0.13) + +Breaking change + +- Removed `errors.DireCause` + +New feature + +- Added `errors.Unwrap` and `errors.As` to align with go 1.13 [#109](https://github.com/dyweb/gommon/issues/109) + ## v0.0.12 Released on 2019/05/04 diff --git a/Dockerfile b/Dockerfile index ee68ccf..a24198a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ # # The builder-image go-dev can be found in hack/go-dev # Versions can be found on https://hub.docker.com/r/dyweb/go-dev/tags -FROM dyweb/go-dev:1.12.4 as builder +FROM dyweb/go-dev:1.13.6 as builder LABEL maintainer="contact@dongyue.io" diff --git a/Makefile b/Makefile index 7f656f2..c731aff 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,7 @@ GO = GO111MODULE=on go # -- build vars --- PKGS =./errors/... ./generator/... ./httpclient/... ./log/... ./noodle/... ./util/... PKGST =./cmd ./errors ./generator ./httpclient ./log ./noodle ./util -VERSION = 0.0.12 +VERSION = 0.0.13 BUILD_COMMIT := $(shell git rev-parse HEAD) BUILD_TIME := $(shell date +%Y-%m-%dT%H:%M:%S%z) CURRENT_USER = $(USER) @@ -54,8 +54,8 @@ fmt: # --- build --- .PHONY: clean build build-linux build-mac build-win build-all clean: - rm ./build/gommon - rm ./build/gommon-* + rm -f ./build/gommon + rm -f ./build/gommon-* build: $(GO) build -ldflags "$(FLAGS)" -o ./build/gommon ./cmd/gommon build-linux: diff --git a/ROADMAP.md b/ROADMAP.md index 22c1771..d7f47bc 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,12 +2,11 @@ ## Up coming -### 0.0.13 +### 0.0.14 -Was 0.0.12 but move httpclient from go.ice is needed and improve the error package is going to take a while, -so changed milestone to 0.0.13. +From 0.0.13 -- [ ] align errors with x/errors which will become the default [#109](https://github.com/dyweb/gommon/issues/109) +- [ ] log UI, parse log output etc. From 0.0.11 @@ -26,6 +25,10 @@ From 0.0.9 ## Finished +### 0.0.13 + +- [x] align errors with x/errors which will become the default [#109](https://github.com/dyweb/gommon/issues/109) + ### 0.0.12 - [x] move httpclient from go.ice diff --git a/errors/cause.go b/errors/cause.go index 8386498..5c0ff52 100644 --- a/errors/cause.go +++ b/errors/cause.go @@ -29,4 +29,4 @@ func Cause(err error) error { } } return err -} \ No newline at end of file +} diff --git a/errors/cause_test.go b/errors/cause_test.go index ca3c6a2..63ab46e 100644 --- a/errors/cause_test.go +++ b/errors/cause_test.go @@ -21,4 +21,4 @@ func TestCause(t *testing.T) { stderr := stderrors.New("std") assert.Equal(t, stderr, errors.Cause(stderr)) -} \ No newline at end of file +} diff --git a/go.mod b/go.mod index 61794e2..f9c646d 100644 --- a/go.mod +++ b/go.mod @@ -2,12 +2,10 @@ module github.com/dyweb/gommon require ( github.com/davecgh/go-spew v1.1.1 - github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 - github.com/spf13/cobra v0.0.3 - github.com/spf13/pflag v1.0.3 // indirect - github.com/stretchr/testify v1.3.0 - gopkg.in/yaml.v2 v2.2.2 + github.com/spf13/cobra v0.0.5 + github.com/stretchr/testify v1.4.0 + gopkg.in/yaml.v2 v2.2.7 ) go 1.13 diff --git a/go.sum b/go.sum index 70790ab..8edd68c 100644 --- a/go.sum +++ b/go.sum @@ -1,20 +1,45 @@ +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 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/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= +github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= 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/spf13/cobra v0.0.3 h1:ZlrZ4XsMRm04Fr5pSFxBgfND2EBVa1nLpiy1stUsX/8= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v0.0.5 h1:f0B+LkLX6DtmRH1isoNA9VTtNUK9K8xYd28JNNfOv/s= +github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= +github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= +github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 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/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.7 h1:VUgggvou5XRW9mHwD/yXxIYSMtY0zoKQf/v226p2nyo= +gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/hack/go-dev/Makefile b/hack/go-dev/Makefile index 86b89c6..1e451c7 100644 --- a/hack/go-dev/Makefile +++ b/hack/go-dev/Makefile @@ -1,5 +1,5 @@ DOCKER_REPO = dyweb/go-dev -GO_VERSIONS = 1.12.13 1.13.4 +GO_VERSIONS = 1.13.6 BUILDS = $(addprefix build-, $(GO_VERSIONS)) PUSHS = $(addprefix push-, $(GO_VERSIONS))