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

Commit 079a526

Browse files
committed
Use a constant for the manifest/lock file names
We can’t reference dep.ManifestName/LockName because it would create a circular reference
1 parent 0b130c4 commit 079a526

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

test/test.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ var (
2929
PrintLogs *bool = flag.Bool("logs", false, "log stdin/stdout of test commands")
3030
)
3131

32+
const (
33+
manifestName string = "manifest.toml"
34+
lockName string = "lock.toml"
35+
)
36+
3237
func init() {
3338
switch runtime.GOOS {
3439
case "windows":
@@ -584,7 +589,7 @@ func (h *Helper) Cleanup() {
584589

585590
// ReadManifest returns the manifest in the current directory.
586591
func (h *Helper) ReadManifest() string {
587-
m := filepath.Join(h.pwd(), "manifest.toml")
592+
m := filepath.Join(h.pwd(), manifestName)
588593
h.MustExist(m)
589594

590595
f, err := ioutil.ReadFile(m)
@@ -594,7 +599,7 @@ func (h *Helper) ReadManifest() string {
594599

595600
// ReadLock returns the lock in the current directory.
596601
func (h *Helper) ReadLock() string {
597-
l := filepath.Join(h.pwd(), "lock.toml")
602+
l := filepath.Join(h.pwd(), lockName)
598603
h.MustExist(l)
599604

600605
f, err := ioutil.ReadFile(l)

0 commit comments

Comments
 (0)