Skip to content

Commit

Permalink
godoc: simplify using multiple line strings
Browse files Browse the repository at this point in the history
  • Loading branch information
qiulaidongfeng committed Nov 5, 2023
1 parent 7e0917a commit 2783fbb
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions godoc/godoc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2783fbb

Please sign in to comment.