Skip to content

Commit

Permalink
Fix windows test
Browse files Browse the repository at this point in the history
Signed-off-by: Edward McFarlane <emcfarlane@buf.build>
  • Loading branch information
emcfarlane committed Dec 20, 2024
1 parent f94f80d commit 0013a35
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/protoc-gen-connect-go/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func testCmpToTestdata(t *testing.T, content, path string) {
assert.Nil(t, err)
// Strip the copyright header and generated by line.
fileContent := string(b)
fileContent = fileContent[strings.Index(fileContent, "\n\n")+2:]
fileContent = fileContent[strings.Index(fileContent, "// Code generated by"):]

Check failure on line 183 in cmd/protoc-gen-connect-go/main_test.go

View workflow job for this annotation

GitHub Actions / ci (1.23.x)

offBy1: Index() can return -1; maybe you wanted to do Index()+1 (gocritic)
fileContent = strings.Replace(fileContent, "Code generated by protoc-gen-connect-go.", "Code generated by main.", 1)
assert.Zero(t, cmp.Diff(content, fileContent))
}
Expand Down

0 comments on commit 0013a35

Please sign in to comment.