Skip to content

Commit 9e3aea6

Browse files
committed
Use regexp.QuoteMeta for workDir
1 parent 9e016c6 commit 9e3aea6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

go/test/netspoc_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ func runTest(t *testing.T, tc test, d descr) {
247247
}
248248

249249
// Normalize stderr.
250-
re := regexp.MustCompile(workDir + `/code\.tmp\d{6,12}`)
250+
re := regexp.MustCompile(regexp.QuoteMeta(workDir) + `/code\.tmp\d{6,12}`)
251251
if inDir != "" {
252252
stderr = strings.ReplaceAll(stderr, inDir+"/", "")
253253
stderr = strings.ReplaceAll(stderr, inDir, path.Base(inDir))

0 commit comments

Comments
 (0)