From a8570e12b66263a4d2bc406de590d7651e494615 Mon Sep 17 00:00:00 2001 From: Rebecca Stambler Date: Mon, 12 Nov 2018 17:37:20 -0500 Subject: [PATCH] internal/lsp: use bytes.Buffer instead of strings.Builder x/tools only supports Go 1.10 and Go 1.11, but it's such a simple fix to support 1.9, so change from strings.Builder to bytes.Buffer. Change-Id: Ie37d6c7da7ce7dbbd4e9ec933e1eff3304142a59 Reviewed-on: https://go-review.googlesource.com/c/149178 Reviewed-by: Ian Cottrell Run-TryBot: Rebecca Stambler TryBot-Result: Gobot Gobot --- internal/lsp/source/completion.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/lsp/source/completion.go b/internal/lsp/source/completion.go index af7131fc..2230f608 100644 --- a/internal/lsp/source/completion.go +++ b/internal/lsp/source/completion.go @@ -1,6 +1,7 @@ package source import ( + "bytes" "context" "fmt" "go/ast" @@ -105,7 +106,6 @@ func completions(file *ast.File, pos token.Pos, fset *token.FileSet, pkg *types. if items, ok := complit(path, pos, pkg, info, found); ok { return items, "", nil } - switch n := path[0].(type) { case *ast.Ident: // Set the filter prefix. @@ -440,7 +440,7 @@ func formatType(typ types.Type, qualifier types.Qualifier) (detail string, kind // formatParams correctly format the parameters of a function. func formatParams(t *types.Tuple, variadic bool, qualifier types.Qualifier) string { - var b strings.Builder + var b bytes.Buffer b.WriteByte('(') for i := 0; i < t.Len(); i++ { if i > 0 {