Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
b0afb931
Commit
b0afb931
authored
Nov 01, 2010
by
Brad Fitzpatrick
Committed by
Rob Pike
Nov 01, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use strings.Contains in src/cmd/...
R=r CC=golang-dev, r2, rsc
https://golang.org/cl/2819041
parent
7996924c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
src/cmd/cgo/gcc.go
src/cmd/cgo/gcc.go
+4
-4
src/cmd/goinstall/download.go
src/cmd/goinstall/download.go
+1
-1
No files found.
src/cmd/cgo/gcc.go
View file @
b0afb931
...
...
@@ -223,14 +223,14 @@ func (p *Package) guessKinds(f *File) []*Name {
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
}
...
...
src/cmd/goinstall/download.go
View file @
b0afb931
...
...
@@ -38,7 +38,7 @@ var launchpad = regexp.MustCompile(`^(launchpad\.net/([a-z0-9A-Z_.\-]+(/[a-z0-9A
// 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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment