From 2783fbb7e452ea496e7ac377da63708877f7c2f2 Mon Sep 17 00:00:00 2001 From: qiulaidongfeng <2645477756@qq.com> Date: Sun, 5 Nov 2023 14:20:13 +0800 Subject: [PATCH] godoc: simplify using multiple line strings For golang/go#26627 --- godoc/godoc_test.go | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/godoc/godoc_test.go b/godoc/godoc_test.go index 7f3470ed077..0079d330228 100644 --- a/godoc/godoc_test.go +++ b/godoc/godoc_test.go @@ -325,19 +325,17 @@ func TestSrcToPkgLinkFunc(t *testing.T) { } func TestFilterOutBuildAnnotations(t *testing.T) { - // TODO: simplify this by using a multiline string once we stop - // using go vet from 1.10 on the build dashboard. - // https://golang.org/issue/26627 - src := []byte("// +build !foo\n" + - "// +build !anothertag\n" + - "\n" + - "// non-tag comment\n" + - "\n" + - "package foo\n" + - "\n" + - "func bar() int {\n" + - " return 42\n" + - "}\n") + src := []byte( + `// +build !foo + // +build !anothertag + + // non-tag comment + + package foo + + func bar() int { + return 42 + }`) fset := token.NewFileSet() af, err := parser.ParseFile(fset, "foo.go", src, parser.ParseComments)