switch {
default:
continue
- case strings.Index(line, ": useless type name in empty declaration") >= 0:
+ case strings.Contains(line, ": useless type name in empty declaration"):
what = "type"
isConst[i] = false
- case strings.Index(line, ": statement with no effect") >= 0:
+ case strings.Contains(line, ": statement with no effect"):
what = "not-type" // const or func or var
- case strings.Index(line, "undeclared") >= 0:
+ case strings.Contains(line, "undeclared"):
error(noPos, "%s", strings.TrimSpace(line[colon+1:]))
- case strings.Index(line, "is not an integer constant") >= 0:
+ case strings.Contains(line, "is not an integer constant"):
isConst[i] = false
continue
}
// download checks out or updates pkg from the remote server.
func download(pkg string) (string, os.Error) {
- if strings.Index(pkg, "..") >= 0 {
+ if strings.Contains(pkg, "..") {
return "", os.ErrorString("invalid path (contains ..)")
}
if m := bitbucket.FindStringSubmatch(pkg); m != nil {