From 368242a419c90c3295de8936e6f554a042958933 Mon Sep 17 00:00:00 2001 From: Josue Giron Date: Sat, 21 Nov 2026 19:53:47 +0000 Subject: [PATCH] build(otel): require log v1.7.5 Drops errors v0.6.1 and go-errors from otel users' module graph. Fix the stale install line in the package doc and the README versions. Co-Authored-By: Claude Opus 5.5 --- README.md | 4 ++-- otel/go.mod | 7 ++----- otel/go.sum | 10 ++++------ otel/handler.go | 2 +- 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 7f5b203..f4be740 100644 --- a/README.md +++ b/README.md @@ -103,10 +103,10 @@ logger.Info("service started") Upgrading from `log` v1.4.x or earlier, where `otel` was part of the root module, raise both together: ```sh -go get github.com/jgolang/log@v1.7.4 github.com/jgolang/log/otel@v1.8.0 +go get github.com/jgolang/log@v1.7.5 github.com/jgolang/log/otel@v1.8.1 ``` -Raising only `log` makes Go report that no required module provides `github.com/jgolang/log/otel`; `log/otel` v1.5.0 and later require `log` v1.5.0 or later, so adding it raises `log` too. New users run `go get github.com/jgolang/log@v1.7.4 github.com/jgolang/log/otel@v1.8.0`. `SetHandlerWrapper` and `WithHandlerWrapper`, used below, need `log` v1.6.0. +Raising only `log` makes Go report that no required module provides `github.com/jgolang/log/otel`; `log/otel` v1.5.0 and later require `log` v1.5.0 or later, so adding it raises `log` too. New users run `go get github.com/jgolang/log@v1.7.5 github.com/jgolang/log/otel@v1.8.1`. `SetHandlerWrapper` and `WithHandlerWrapper`, used below, need `log` v1.6.0. Wrap the logger's handler with `otel.NewOtelHandler` so records logged with a context carry its `trace_id` and `span_id` and are added to the span as events: diff --git a/otel/go.mod b/otel/go.mod index dd71b16..b0226c2 100644 --- a/otel/go.mod +++ b/otel/go.mod @@ -3,12 +3,9 @@ module github.com/jgolang/log/otel go 1.26.2 require ( - github.com/jgolang/log v1.7.1 + github.com/jgolang/log v1.7.5 go.opentelemetry.io/otel v1.28.0 go.opentelemetry.io/otel/trace v1.28.0 ) -require ( - github.com/go-errors/errors v1.5.1 // indirect - github.com/jgolang/errors v0.6.1 // indirect -) +require github.com/jgolang/errors v0.8.0 // indirect diff --git a/otel/go.sum b/otel/go.sum index b043f90..3d06973 100644 --- a/otel/go.sum +++ b/otel/go.sum @@ -1,13 +1,11 @@ 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/go-errors/errors v1.5.1 h1:ZwEMSLRCapFLflTpT7NKaAc7ukJ8ZPEjzlxt8rPN8bk= -github.com/go-errors/errors v1.5.1/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/jgolang/errors v0.6.1 h1:D8LRvoIj2w4vrRo7cY0t4OuL0xrMxcioSMeYmgoTxLc= -github.com/jgolang/errors v0.6.1/go.mod h1:7jzxJ5Ox468U7Jk0R+JWI3sfPfLGSwPOie7ISDYlVhY= -github.com/jgolang/log v1.7.1 h1:uXl+LJsIdT6VyfkqpAcHXnFnX6tkQjmw3mstAapQFuw= -github.com/jgolang/log v1.7.1/go.mod h1:bZgWMYRyX1aKU2HcsO8QWW4aAGVde6GVaKHN8OL38SM= +github.com/jgolang/errors v0.8.0 h1:7VGykxmM5ARsoGNV6v+w0hqSUmTojZ302/RVybDgxSQ= +github.com/jgolang/errors v0.8.0/go.mod h1:JjsTZeVVZMBDhzQ/13gpKoOCnpZNXrmiPZV4etIL2n8= +github.com/jgolang/log v1.7.5 h1:WTRFsLRQIzwy7bUkgXBD1PspBcpmyPryg1FWXvzh2j8= +github.com/jgolang/log v1.7.5/go.mod h1:CR4Jc7i3bRVdMlYp0b5jAL5V8My3d54U2IBHK+oxDZk= 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.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= diff --git a/otel/handler.go b/otel/handler.go index c32460c..875b2b4 100644 --- a/otel/handler.go +++ b/otel/handler.go @@ -4,7 +4,7 @@ // do not depend on OpenTelemetry; it has been since log v1.5.0. Upgrading from // log v1.4.x or earlier, raise both modules together: // -// go get github.com/jgolang/log@v1.6.0 github.com/jgolang/log/otel@v1.6.0 +// go get github.com/jgolang/log@latest github.com/jgolang/log/otel@latest // // Attach the handler to a jgolang logger with log.SetHandlerWrapper or the // log.WithHandlerWrapper option (log v1.6.0 or later):