From 15875dc9a1559a0f88ebac6e01fead6c8d9a2c97 Mon Sep 17 00:00:00 2001 From: NotZippy Date: Tue, 2 May 2017 14:28:33 -0700 Subject: [PATCH] Added allowance for test packages to co-exist --- harness/reflect.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/harness/reflect.go b/harness/reflect.go index 77d6007..4e9fb47 100644 --- a/harness/reflect.go +++ b/harness/reflect.go @@ -160,8 +160,21 @@ func ProcessSource(roots []string) (*SourceInfo, *revel.Error) { return nil } + // Ignore packages that end with _test + for i := range pkgs { + if len(i)>6 { + if string(i[len(i) - 5:]) == "_test" { + delete(pkgs, i) + } + } + } + + // There should be only one package in this directory. if len(pkgs) > 1 { + for i := range pkgs { + println("Found package ",i) + } log.Println("Most unexpected! Multiple packages in a single directory:", pkgs) }