tighter constraints on allowed paths.

Change-Id: Ie6b121e4733e45288a36dbc2426f556fd5e2832d
This commit is contained in:
sm
2016-03-02 22:06:17 -08:00
parent 73438f2420
commit 5de44ba4d6
2 changed files with 30 additions and 8 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ import (
// Valid checks that p will not confuse the go tool if added to packages.
func Valid(p string, packages []Package) bool {
for _, pkg := range packages {
if strings.HasPrefix(pkg.path, p) {
if strings.HasPrefix(pkg.path, p) || strings.HasPrefix(p, pkg.path) {
return false
}
}