Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[filebeat] Fix long filepaths in diagnostics exceeding max path limits on Windows #40909

Merged
2 changes: 1 addition & 1 deletion x-pack/filebeat/input/cel/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@ func cloneMap(dst, src mapstr.M) {
// walkMap walks to all ends of the provided path in m and applies fn to the
// final element of each walk. Nested arrays are not handled.
func walkMap(m mapstr.M, path string, fn func(parent mapstr.M, key string)) {
//nolint:typecheck // typecheck linter is buggy and thinks rest is not used.
//nolint:typecheck,nolintlint // typecheck linter is buggy and thinks rest is not used.
aleksmaus marked this conversation as resolved.
Show resolved Hide resolved
key, rest, more := strings.Cut(path, ".")
v, ok := m[key]
if !ok {
Expand Down
10 changes: 5 additions & 5 deletions x-pack/filebeat/input/cel/input_test.go
aleksmaus marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -448,9 +448,9 @@ var inputTests = []struct {
</item>
</order>
`
io.ReadAll(r.Body)
_, _ = io.ReadAll(r.Body)
r.Body.Close()
w.Write([]byte(text))
_, _ = w.Write([]byte(text))
})
server := httptest.NewServer(r)
config["resource.url"] = server.URL
Expand Down Expand Up @@ -582,7 +582,7 @@ var inputTests = []struct {
msg = fmt.Sprintf(`{"error":"expected method was %#q"}`, http.MethodGet)
}

w.Write([]byte(msg))
_, _ = w.Write([]byte(msg))
},
want: []map[string]interface{}{
{
Expand Down Expand Up @@ -630,7 +630,7 @@ var inputTests = []struct {
msg = fmt.Sprintf(`{"error":"expected method was %#q"}`, http.MethodGet)
}

w.Write([]byte(msg))
_, _ = w.Write([]byte(msg))
},
want: []map[string]interface{}{
{
Expand Down Expand Up @@ -676,7 +676,7 @@ var inputTests = []struct {
msg = fmt.Sprintf(`{"error":"expected method was %#q"}`, http.MethodGet)
}

w.Write([]byte(msg))
_, _ = w.Write([]byte(msg))
},
want: []map[string]interface{}{
{
Expand Down
4 changes: 2 additions & 2 deletions x-pack/filebeat/input/httpjson/input_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1357,9 +1357,9 @@ var testCases = []struct {
</item>
</order>
`
io.ReadAll(r.Body)
_, _ = io.ReadAll(r.Body)
r.Body.Close()
w.Write([]byte(text))
_, _ = w.Write([]byte(text))
aleksmaus marked this conversation as resolved.
Show resolved Hide resolved
})
server := httptest.NewServer(r)
config["request.url"] = server.URL
Expand Down
Loading