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

Commit cf81674

Browse files
authored
Merge pull request #914 from darkowlzz/status-without-lock
fix(status): error out when lock not found
2 parents f6f8423 + 7ed266f commit cf81674

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

cmd/dep/status.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,7 @@ func runStatusAll(ctx *dep.Ctx, out outputter, p *dep.Project, sm gps.SourceMana
261261
var digestMismatch, hasMissingPkgs bool
262262

263263
if p.Lock == nil {
264-
// TODO if we have no lock file, do...other stuff
265-
return digestMismatch, hasMissingPkgs, nil
264+
return digestMismatch, hasMissingPkgs, errors.Errorf("no Gopkg.lock found. Run `dep ensure` to generate lock file")
266265
}
267266

268267
// While the network churns on ListVersions() requests, statically analyze

cmd/dep/testdata/harness_tests/status/without_lock/final/Gopkg.toml

Whitespace-only changes.

cmd/dep/testdata/harness_tests/status/without_lock/initial/Gopkg.toml

Whitespace-only changes.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"commands": [
3+
["status"]
4+
],
5+
"error-expected": "no Gopkg.lock found. Run `dep ensure` to generate lock file"
6+
}

0 commit comments

Comments
 (0)