Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Commit

Permalink
Use a constant for the manifest/lock file names
Browse files Browse the repository at this point in the history
We can’t reference dep.ManifestName/LockName because it would create a circular reference
  • Loading branch information
carolynvs committed Apr 5, 2017
1 parent 0b130c4 commit 079a526
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 079a526

Please sign in to comment.