diff --git a/go.mod b/go.mod index 9b9c904..cdb2b00 100644 --- a/go.mod +++ b/go.mod @@ -2,16 +2,10 @@ module github.com/mikhalytch/eggs go 1.18 -require ( - github.com/fgrosse/zaptest v1.2.1 - github.com/stretchr/testify v1.8.4 - go.uber.org/zap v1.24.0 -) +require github.com/stretchr/testify v1.8.4 require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - go.uber.org/atomic v1.10.0 // indirect - go.uber.org/multierr v1.9.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 64815c7..fa4b6e6 100644 --- a/go.sum +++ b/go.sum @@ -1,30 +1,10 @@ -github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= 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/fgrosse/zaptest v1.2.1 h1:QnbFHkIZcfICCzY1Grybxw9Em37RbGI6z5Lt6K/ROgw= -github.com/fgrosse/zaptest v1.2.1/go.mod h1:qc5bd351XNR70Wy4GZU0LS+OEHzA/IrF7vi6zOfQlf4= -github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= -github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs= -github.com/onsi/gomega v1.4.3 h1:RE1xgDvH7imwFD45h+u2SgIfERHlS2yNG4DObb5BSKU= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= 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/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= -go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= -go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= -go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= -go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= -go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= -golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= -golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= 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/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/zap/field.go b/zap/field.go deleted file mode 100644 index ec55d6a..0000000 --- a/zap/field.go +++ /dev/null @@ -1,11 +0,0 @@ -package zap - -import ( - "go.uber.org/zap" -) - -// Int64 constructs a field with the given key and value. -func Int64[T ~int64](key string, val T) zap.Field { return zap.Int64(key, int64(val)) } - -// String constructs a field with the given key and value. -func String[T ~string](key string, val T) zap.Field { return zap.String(key, string(val)) } diff --git a/zap/field_test.go b/zap/field_test.go deleted file mode 100644 index 6413a4e..0000000 --- a/zap/field_test.go +++ /dev/null @@ -1,31 +0,0 @@ -package zap_test - -import ( - "bytes" - "testing" - - "github.com/fgrosse/zaptest" - "github.com/stretchr/testify/require" - - gzap "github.com/mikhalytch/eggs/zap" -) - -func TestString(t *testing.T) { - type Name string - - bb := bytes.NewBuffer(make([]byte, 0)) - logger := zaptest.LoggerWriter(bb) - - logger.Info("test msg", gzap.String("key", Name("name"))) - require.Equal(t, `INFO test msg {"key": "name"}`+"\n", bb.String()) -} - -func TestInt64(t *testing.T) { - type Value int64 - - bb := bytes.NewBuffer(make([]byte, 0)) - logger := zaptest.LoggerWriter(bb) - - logger.Info("test msg", gzap.Int64("key", Value(2))) - require.Equal(t, `INFO test msg {"key": 2}`+"\n", bb.String()) -}