From 920e5d44e74aeefcff98440334c4f2bf1b0659d5 Mon Sep 17 00:00:00 2001 From: Carolyn Van Slyck Date: Tue, 4 Apr 2017 21:05:53 -0500 Subject: [PATCH] Use a constant for the manifest/lock file names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We can’t reference dep.ManifestName/LockName because it would create a circular reference --- test/test.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/test.go b/test/test.go index 3ea6668196..951c57e123 100644 --- a/test/test.go +++ b/test/test.go @@ -29,6 +29,11 @@ var ( PrintLogs *bool = flag.Bool("logs", false, "log stdin/stdout of test commands") ) +const ( + manifestName string = "manifest.toml" + lockName string = "lock.toml" +) + func init() { switch runtime.GOOS { case "windows": @@ -584,7 +589,7 @@ func (h *Helper) Cleanup() { // ReadManifest returns the manifest in the current directory. func (h *Helper) ReadManifest() string { - m := filepath.Join(h.pwd(), "manifest.toml") + m := filepath.Join(h.pwd(), manifestName) h.MustExist(m) f, err := ioutil.ReadFile(m) @@ -594,7 +599,7 @@ func (h *Helper) ReadManifest() string { // ReadLock returns the lock in the current directory. func (h *Helper) ReadLock() string { - l := filepath.Join(h.pwd(), "lock.toml") + l := filepath.Join(h.pwd(), lockName) h.MustExist(l) f, err := ioutil.ReadFile(l)