cmd/guru: avoid bug when -scope=""
strings.Split is not your friend. Change-Id: I829f08f113f3340b2dd865aea47f5759a427f7c4 Reviewed-on: https://go-review.googlesource.com/22116 Reviewed-by: Michael Matloob <matloob@golang.org>
This commit is contained in:
parent
0c4d9b3099
commit
5e468032ea
|
@ -194,11 +194,17 @@ func main() {
|
|||
}
|
||||
}
|
||||
|
||||
// Avoid corner case of split("").
|
||||
var scope []string
|
||||
if *scopeFlag != "" {
|
||||
scope = strings.Split(*scopeFlag, ",")
|
||||
}
|
||||
|
||||
// Ask the guru.
|
||||
query := Query{
|
||||
Pos: posn,
|
||||
Build: ctxt,
|
||||
Scope: strings.Split(*scopeFlag, ","),
|
||||
Scope: scope,
|
||||
PTALog: ptalog,
|
||||
Reflection: *reflectFlag,
|
||||
Output: output,
|
||||
|
|
Loading…
Reference in New Issue