From 93d379b059a2c9a7c1813c917bf24c0e34fa6f4a Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Sun, 17 Sep 2023 10:17:20 +0200 Subject: [PATCH] fixup! Show pprof labels in the threads request --- service/dap/server.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/service/dap/server.go b/service/dap/server.go index 19c1856b4a..08a3b2e7d1 100644 --- a/service/dap/server.go +++ b/service/dap/server.go @@ -1800,7 +1800,7 @@ func (s *Session) onThreadsRequest(request *dap.ThreadsRequest) { if g.Thread != nil && g.Thread.ThreadID() != 0 { thread = fmt.Sprintf(" (Thread %d)", g.Thread.ThreadID()) } - labels := "" + var labels strings.Builder if len(g.Labels()) > 0 { var keys []string for k := range g.Labels() { @@ -1808,13 +1808,13 @@ func (s *Session) onThreadsRequest(request *dap.ThreadsRequest) { } sort.Strings(keys) for _, k := range keys { - labels += fmt.Sprintf(" %s=%s", k, g.Labels()[k]) + fmt.Fprintf(&labels, " %s=%s", k, g.Labels()[k]) } } // File name and line number are communicated via `stackTrace` // so no need to include them here. loc := g.UserCurrent() - threads[i].Name = fmt.Sprintf("%s[Go %d%s] %s%s", selected, g.ID, labels, fnName(&loc), thread) + threads[i].Name = fmt.Sprintf("%s[Go %d%s] %s%s", selected, g.ID, labels.String(), fnName(&loc), thread) threads[i].Id = int(g.ID) } }