internal/lsp: do not log failed suggested fix for fillstruct to stderr

Avoid logging to stderr as it will interfere with LSP communication.

Change-Id: Ic9ff4f3555eabb8b0b6503650df7de5ddb76ef98
Reviewed-on: https://go-review.googlesource.com/c/tools/+/249997
Run-TryBot: Pontus Leitzler <leitzler@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
diff --git a/internal/lsp/analysis/fillstruct/fillstruct.go b/internal/lsp/analysis/fillstruct/fillstruct.go
index 495d646..c760b69 100644
--- a/internal/lsp/analysis/fillstruct/fillstruct.go
+++ b/internal/lsp/analysis/fillstruct/fillstruct.go
@@ -13,7 +13,6 @@
 	"go/format"
 	"go/token"
 	"go/types"
-	"log"
 	"unicode"
 
 	"golang.org/x/tools/go/analysis"
@@ -254,8 +253,7 @@
 
 	var newExpr bytes.Buffer
 	if err := format.Node(&newExpr, fakeFset, cl); err != nil {
-		log.Printf("failed to format %s: %v", cl.Type, err)
-		return nil, err
+		return nil, fmt.Errorf("failed to format %s: %v", cl.Type, err)
 	}
 	split = bytes.Split(newExpr.Bytes(), []byte("\n"))
 	newText := bytes.NewBuffer(nil)