1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-11-25 22:41:46 +02:00

chore(deps): update module mvdan.cc/gofumpt to v0.9.0 (#7292)

This PR contains the following updates:

| Package | Change | Age | Confidence |
|---|---|---|---|
| [mvdan.cc/gofumpt](https://redirect.github.com/mvdan/gofumpt) |
`v0.8.0` -> `v0.9.0` |
[![age](https://developer.mend.io/api/mc/badges/age/go/mvdan.cc%2fgofumpt/v0.9.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/mvdan.cc%2fgofumpt/v0.8.0/v0.9.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>mvdan/gofumpt (mvdan.cc/gofumpt)</summary>

###
[`v0.9.0`](https://redirect.github.com/mvdan/gofumpt/blob/HEAD/CHANGELOG.md#v090---2025-09-02)

[Compare
Source](https://redirect.github.com/mvdan/gofumpt/compare/v0.8.0...v0.9.0)

This release is based on Go 1.25's gofmt, and requires Go 1.24 or later.

A new rule is introduced to "clothe" naked returns for the sake of
clarity.
While there is nothing wrong with naming results in function signatures,
using lone `return` statements can be confusing to the reader.

Go 1.25's `ignore` directives in `go.mod` files are now obeyed;
any directories within the module matching any of the patterns
are now omitted when walking directories, such as with `gofumpt -w .`.

Module information is now loaded via Go's [`x/mod/modfile`
package](https://pkg.go.dev/golang.org/x/mod/modfile)
rather than executing `go mod edit -json`, which is way faster.
This should result in moderate speed-ups when formatting many
directories.

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/open-telemetry/opentelemetry-go).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS45MS4xIiwidXBkYXRlZEluVmVyIjoiNDEuOTEuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiU2tpcCBDaGFuZ2Vsb2ciLCJkZXBlbmRlbmNpZXMiXX0=-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: dmathieu <damien.mathieu@elastic.co>
This commit is contained in:
renovate[bot]
2025-09-03 10:18:12 +02:00
committed by GitHub
parent 295fbdc5f1
commit 83c041a6cd
14 changed files with 41 additions and 43 deletions

View File

@@ -56,7 +56,7 @@ func TestMergedIterator(t *testing.T) {
for _, k := range keys { for _, k := range keys {
result = append(result, attribute.Int(k, num)) result = append(result, attribute.Int(k, num))
} }
return return result
} }
for _, input := range []inputs{ for _, input := range []inputs{

View File

@@ -648,7 +648,7 @@ func parsePropertyInternal(s string) (p Property, ok bool) {
// If we couldn't find any valid key character, // If we couldn't find any valid key character,
// it means the key is either empty or invalid. // it means the key is either empty or invalid.
if keyStart == keyEnd { if keyStart == keyEnd {
return return p, ok
} }
// Skip spaces after the key: " key< >= value ". // Skip spaces after the key: " key< >= value ".
@@ -658,13 +658,13 @@ func parsePropertyInternal(s string) (p Property, ok bool) {
// A key can have no value, like: " key ". // A key can have no value, like: " key ".
ok = true ok = true
p.key = s[keyStart:keyEnd] p.key = s[keyStart:keyEnd]
return return p, ok
} }
// If we have not reached the end and we can't find the '=' delimiter, // If we have not reached the end and we can't find the '=' delimiter,
// it means the property is invalid. // it means the property is invalid.
if s[index] != keyValueDelimiter[0] { if s[index] != keyValueDelimiter[0] {
return return p, ok
} }
// Attempting to parse the value. // Attempting to parse the value.
@@ -690,14 +690,14 @@ func parsePropertyInternal(s string) (p Property, ok bool) {
// we have not reached the end, it means the property is // we have not reached the end, it means the property is
// invalid, something like: " key = value value1". // invalid, something like: " key = value value1".
if index != len(s) { if index != len(s) {
return return p, ok
} }
// Decode a percent-encoded value. // Decode a percent-encoded value.
rawVal := s[valueStart:valueEnd] rawVal := s[valueStart:valueEnd]
unescapeVal, err := url.PathUnescape(rawVal) unescapeVal, err := url.PathUnescape(rawVal)
if err != nil { if err != nil {
return return p, ok
} }
value := replaceInvalidUTF8Sequences(len(rawVal), unescapeVal) value := replaceInvalidUTF8Sequences(len(rawVal), unescapeVal)
@@ -706,7 +706,7 @@ func parsePropertyInternal(s string) (p Property, ok bool) {
p.hasValue = true p.hasValue = true
p.value = value p.value = value
return return p, ok
} }
func skipSpace(s string, offset int) int { func skipSpace(s string, offset int) int {

View File

@@ -568,9 +568,8 @@ func (bio *baggageInteroperationTest) addAndRecordBaggage(t *testing.T, ctx cont
return ctx return ctx
} }
func generateBaggageKeys(key string) (otKey, otelKey string) { func generateBaggageKeys(key string) (string, string) {
otKey, otelKey = key+"-Ot", key+"-Otel" return key + "-Ot", key + "-Otel"
return
} }
// helpers // helpers

View File

@@ -145,15 +145,16 @@ func (c *mockCollector) getInjectHTTPStatus() int {
return status return status
} }
func (c *mockCollector) getInjectResponseHeader() (h map[string]string) { func (c *mockCollector) getInjectResponseHeader() map[string]string {
var h map[string]string
if len(c.injectResponseHeader) == 0 { if len(c.injectResponseHeader) == 0 {
return return h
} }
h, c.injectResponseHeader = c.injectResponseHeader[0], c.injectResponseHeader[1:] h, c.injectResponseHeader = c.injectResponseHeader[0], c.injectResponseHeader[1:]
if len(c.injectResponseHeader) == 0 { if len(c.injectResponseHeader) == 0 {
c.injectResponseHeader = nil c.injectResponseHeader = nil
} }
return return h
} }
func readRequest(r *http.Request) ([]byte, error) { func readRequest(r *http.Request) ([]byte, error) {

View File

@@ -234,6 +234,6 @@ require (
gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect
honnef.co/go/tools v0.6.1 // indirect honnef.co/go/tools v0.6.1 // indirect
mvdan.cc/gofumpt v0.8.0 // indirect mvdan.cc/gofumpt v0.9.0 // indirect
mvdan.cc/unparam v0.0.0-20250301125049-0df0534333a4 // indirect mvdan.cc/unparam v0.0.0-20250301125049-0df0534333a4 // indirect
) )

View File

@@ -673,7 +673,7 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.6.1 h1:R094WgE8K4JirYjBaOpz/AvTyUu/3wbmAoskKN/pxTI= honnef.co/go/tools v0.6.1 h1:R094WgE8K4JirYjBaOpz/AvTyUu/3wbmAoskKN/pxTI=
honnef.co/go/tools v0.6.1/go.mod h1:3puzxxljPCe8RGJX7BIy1plGbxEOZni5mR2aXe3/uk4= honnef.co/go/tools v0.6.1/go.mod h1:3puzxxljPCe8RGJX7BIy1plGbxEOZni5mR2aXe3/uk4=
mvdan.cc/gofumpt v0.8.0 h1:nZUCeC2ViFaerTcYKstMmfysj6uhQrA2vJe+2vwGU6k= mvdan.cc/gofumpt v0.9.0 h1:W0wNHMSvDBDIyZsm3nnGbVfgp5AknzBrGJnfLCy501w=
mvdan.cc/gofumpt v0.8.0/go.mod h1:vEYnSzyGPmjvFkqJWtXkh79UwPWP9/HMxQdGEXZHjpg= mvdan.cc/gofumpt v0.9.0/go.mod h1:3xYtNemnKiXaTh6R4VtlqDATFwBbdXI8lJvH/4qk7mw=
mvdan.cc/unparam v0.0.0-20250301125049-0df0534333a4 h1:WjUu4yQoT5BHT1w8Zu56SP8367OuBV5jvo+4Ulppyf8= mvdan.cc/unparam v0.0.0-20250301125049-0df0534333a4 h1:WjUu4yQoT5BHT1w8Zu56SP8367OuBV5jvo+4Ulppyf8=
mvdan.cc/unparam v0.0.0-20250301125049-0df0534333a4/go.mod h1:rthT7OuvRbaGcd5ginj6dA2oLE7YNlta9qhBNNdCaLE= mvdan.cc/unparam v0.0.0-20250301125049-0df0534333a4/go.mod h1:rthT7OuvRbaGcd5ginj6dA2oLE7YNlta9qhBNNdCaLE=

View File

@@ -24,22 +24,20 @@ var (
spanID = mustSpanIDFromHex(spanIDStr) spanID = mustSpanIDFromHex(spanIDStr)
) )
func mustTraceIDFromHex(s string) (t trace.TraceID) { func mustTraceIDFromHex(s string) trace.TraceID {
var err error t, err := trace.TraceIDFromHex(s)
t, err = trace.TraceIDFromHex(s)
if err != nil { if err != nil {
panic(err) panic(err)
} }
return return t
} }
func mustSpanIDFromHex(s string) (t trace.SpanID) { func mustSpanIDFromHex(s string) trace.SpanID {
var err error t, err := trace.SpanIDFromHex(s)
t, err = trace.SpanIDFromHex(s)
if err != nil { if err != nil {
panic(err) panic(err)
} }
return return t
} }
type outOfThinAirPropagator struct { type outOfThinAirPropagator struct {

View File

@@ -121,7 +121,7 @@ func hostIPNamePort(hostWithPort string) (ip, name string, port int) {
if parsedPort, err = strconv.ParseUint(portPart, 10, 16); err == nil { if parsedPort, err = strconv.ParseUint(portPart, 10, 16); err == nil {
port = int(parsedPort) // nolint: gosec // Bit size of 16 checked above. port = int(parsedPort) // nolint: gosec // Bit size of 16 checked above.
} }
return return ip, name, port
} }
// EndUserAttributesFromHTTPRequest generates attributes of the // EndUserAttributesFromHTTPRequest generates attributes of the

View File

@@ -285,7 +285,7 @@ func firstHostPort(source ...string) (host string, port int) {
break break
} }
} }
return return host, port
} }
// RequestHeader returns the contents of h as OpenTelemetry attributes. // RequestHeader returns the contents of h as OpenTelemetry attributes.

View File

@@ -287,27 +287,27 @@ func splitHostPort(hostport string) (host string, port int) {
addrEnd := strings.LastIndex(hostport, "]") addrEnd := strings.LastIndex(hostport, "]")
if addrEnd < 0 { if addrEnd < 0 {
// Invalid hostport. // Invalid hostport.
return return host, port
} }
if i := strings.LastIndex(hostport[addrEnd:], ":"); i < 0 { if i := strings.LastIndex(hostport[addrEnd:], ":"); i < 0 {
host = hostport[1:addrEnd] host = hostport[1:addrEnd]
return return host, port
} }
} else { } else {
if i := strings.LastIndex(hostport, ":"); i < 0 { if i := strings.LastIndex(hostport, ":"); i < 0 {
host = hostport host = hostport
return return host, port
} }
} }
host, pStr, err := net.SplitHostPort(hostport) host, pStr, err := net.SplitHostPort(hostport)
if err != nil { if err != nil {
return return host, port
} }
p, err := strconv.ParseUint(pStr, 10, 16) p, err := strconv.ParseUint(pStr, 10, 16)
if err != nil { if err != nil {
return return host, port
} }
return host, int(p) // nolint: gosec // Bit size of 16 checked above. return host, int(p) // nolint: gosec // Bit size of 16 checked above.
} }

View File

@@ -285,7 +285,7 @@ func firstHostPort(source ...string) (host string, port int) {
break break
} }
} }
return return host, port
} }
// RequestHeader returns the contents of h as OpenTelemetry attributes. // RequestHeader returns the contents of h as OpenTelemetry attributes.

View File

@@ -287,27 +287,27 @@ func splitHostPort(hostport string) (host string, port int) {
addrEnd := strings.LastIndex(hostport, "]") addrEnd := strings.LastIndex(hostport, "]")
if addrEnd < 0 { if addrEnd < 0 {
// Invalid hostport. // Invalid hostport.
return return host, port
} }
if i := strings.LastIndex(hostport[addrEnd:], ":"); i < 0 { if i := strings.LastIndex(hostport[addrEnd:], ":"); i < 0 {
host = hostport[1:addrEnd] host = hostport[1:addrEnd]
return return host, port
} }
} else { } else {
if i := strings.LastIndex(hostport, ":"); i < 0 { if i := strings.LastIndex(hostport, ":"); i < 0 {
host = hostport host = hostport
return return host, port
} }
} }
host, pStr, err := net.SplitHostPort(hostport) host, pStr, err := net.SplitHostPort(hostport)
if err != nil { if err != nil {
return return host, port
} }
p, err := strconv.ParseUint(pStr, 10, 16) p, err := strconv.ParseUint(pStr, 10, 16)
if err != nil { if err != nil {
return return host, port
} }
return host, int(p) // nolint: gosec // Bit size of 16 checked above. return host, int(p) // nolint: gosec // Bit size of 16 checked above.
} }

View File

@@ -286,7 +286,7 @@ func firstHostPort(source ...string) (host string, port int) {
break break
} }
} }
return return host, port
} }
// RequestHeader returns the contents of h as OpenTelemetry attributes. // RequestHeader returns the contents of h as OpenTelemetry attributes.

View File

@@ -287,27 +287,27 @@ func splitHostPort(hostport string) (host string, port int) {
addrEnd := strings.LastIndex(hostport, "]") addrEnd := strings.LastIndex(hostport, "]")
if addrEnd < 0 { if addrEnd < 0 {
// Invalid hostport. // Invalid hostport.
return return host, port
} }
if i := strings.LastIndex(hostport[addrEnd:], ":"); i < 0 { if i := strings.LastIndex(hostport[addrEnd:], ":"); i < 0 {
host = hostport[1:addrEnd] host = hostport[1:addrEnd]
return return host, port
} }
} else { } else {
if i := strings.LastIndex(hostport, ":"); i < 0 { if i := strings.LastIndex(hostport, ":"); i < 0 {
host = hostport host = hostport
return return host, port
} }
} }
host, pStr, err := net.SplitHostPort(hostport) host, pStr, err := net.SplitHostPort(hostport)
if err != nil { if err != nil {
return return host, port
} }
p, err := strconv.ParseUint(pStr, 10, 16) p, err := strconv.ParseUint(pStr, 10, 16)
if err != nil { if err != nil {
return return host, port
} }
return host, int(p) // nolint: gosec // Bit size of 16 checked above. return host, int(p) // nolint: gosec // Bit size of 16 checked above.
} }