Stop glide init from adding packages with found name to imports
diff --git a/action/create.go b/action/create.go
index 5a8d6c4..b55a116 100644
--- a/action/create.go
+++ b/action/create.go
@@ -123,7 +123,7 @@
n := strings.TrimPrefix(pa, vpath)
root, subpkg := util.NormalizeName(n)
- if !config.HasDependency(root) {
+ if !config.HasDependency(root) && root != config.Name {
msg.Info("Found reference to %s\n", n)
d := &cfg.Dependency{
Name: root,
@@ -132,7 +132,7 @@
d.Subpackages = []string{subpkg}
}
config.Imports = append(config.Imports, d)
- } else {
+ } else if config.HasDependency(root) {
if len(subpkg) > 0 {
subpkg = strings.TrimPrefix(subpkg, "/")
d := config.Imports.Get(root)