alpha
Login
or
Join now
boltless.me
/
zoekt
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
fork of https://github.com/sourcegraph/zoekt
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
Fix crash when setting case.
author
Han-Wen Nienhuys
date
10 years ago
(Apr 27, 2016, 1:20 PM +0200)
commit
1c9a1b79
1c9a1b790b74749cc66151811c872f02ca082d4d
parent
d734a3e5
d734a3e52e7afc8eae9f2a45c4eb71579e592bd2
+13
-20
1 changed file
Expand all
Collapse all
Unified
Split
parse.go
+13
-20
parse.go
Reviewed
···
244
244
}
245
245
246
246
for _, q := range qs {
247
247
-
if s, ok := q.(*SubstringQuery); ok && len(s.Pattern) < 3 {
248
248
-
return nil, &SuggestQueryError{
249
249
-
fmt.Sprintf("pattern %q too short", s.Pattern),
250
250
-
fmt.Sprintf("%q", qStr),
247
247
+
if sq, ok := q.(*SubstringQuery); ok {
248
248
+
if len(sq.Pattern) < 3 {
249
249
+
return nil, &SuggestQueryError{
250
250
+
fmt.Sprintf("pattern %q too short", sq.Pattern),
251
251
+
fmt.Sprintf("%q", qStr),
252
252
+
}
251
253
}
252
252
-
}
253
253
-
}
254
254
-
255
255
-
switch setCase {
256
256
-
case "yes":
257
257
-
for _, q := range qs {
258
258
-
q.(*SubstringQuery).CaseSensitive = true
259
259
-
}
260
260
-
case "no":
261
261
-
for _, q := range qs {
262
262
-
q.(*SubstringQuery).CaseSensitive = false
263
263
-
}
264
264
-
case "auto":
265
265
-
for _, q := range qs {
266
266
-
if s, ok := q.(*SubstringQuery); ok {
267
267
-
s.CaseSensitive = (s.Pattern != string(toLower([]byte(s.Pattern))))
254
254
+
switch setCase {
255
255
+
case "yes":
256
256
+
sq.CaseSensitive = true
257
257
+
case "no":
258
258
+
sq.CaseSensitive = false
259
259
+
case "auto":
260
260
+
sq.CaseSensitive = (sq.Pattern != string(toLower([]byte(sq.Pattern))))
268
261
}
269
262
}
270
263
}