### Why are the changes in this PR needed?
The DAP debugger currently truncates variable values to a hardcoded
limit of 100 characters, with no way for callers to configure it.
Long values cannot be inspected or copied whole from a debugger UI.
### What are the changes in this PR?
- Add a new `SetMaxVariableLength` Debugger option (in both
`v1/debug` and the top-level `debug` package)
- A value of 0 disables truncation; the default stays 100 characters
for backward compatibility
- Plumb the limit through `variableManager` and `namedVar`, so it
applies to top-level and nested (object/array/set) variables alike
- Relax `truncatedString` to return the original string unchanged
when the limit is <= 0
- Add `TestTruncatedString` and `TestVariableValueLengthLimit`
covering the default limit, unlimited (0), negative, custom limits,
and boundary cases
### Notes
- `go build ./...` and `go test ./v1/debug/...` both pass
- Default behavior is unchanged; the new option is opt-in
- This PR was developed with AI assistance (Claude Code)
### Further comments
Refs #8890
---------
Signed-off-by: summy wu <summy.wu81@gmail.com>
And update code to conform to the rule.
- Replace unnecessary fmt.Sprintf with string concatenation
- Replace fmt.Sprint with more efficient strconv.Itoa
- Replace static fmt.Errorf calls with more efficient errors.New
Thanks @srenatus for pushing me down this rabbit hole!
Signed-off-by: Anders Eknert <anders@styra.com>