Skip to content

Commit 50cc223

Browse files
cuiweixiegopherbot
authored andcommitted
cmd/cgo: use strings.Contains instead of strings.Index
Change-Id: Iaa623dae50ccae36ad44af25899c6453b6108046 Reviewed-on: https://go-review.googlesource.com/c/go/+/435944 Reviewed-by: Dmitri Shuralyov <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Reviewed-by: Cherry Mui <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> Run-TryBot: Cherry Mui <[email protected]>
1 parent 09daf31 commit 50cc223

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cmd/cgo/out.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ func checkImportSymName(s string) {
427427
fatalf("dynamic symbol %q contains unsupported character", s)
428428
}
429429
}
430-
if strings.Index(s, "//") >= 0 || strings.Index(s, "/*") >= 0 {
430+
if strings.Contains(s, "//") || strings.Contains(s, "/*") {
431431
fatalf("dynamic symbol %q contains Go comment")
432432
}
433433
}

0 commit comments

Comments
 (0)