Skip to content

Commit e0aec26

Browse files
committed
Revert "Fix panic when submit not given args"
This reverts commit 6f8b1be.
1 parent 6f8b1be commit e0aec26

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

cmd/submit.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,6 @@ type submitValidator struct {
290290

291291
// filesExistAndNotADir checks that each file exists and is not a directory.
292292
func (s submitValidator) filesExistAndNotADir(submitPaths []string) error {
293-
if len(submitPaths) == 0 {
294-
return fmt.Errorf("usage: %s submit FILE1 [FILE2 ...]", BinaryName)
295-
}
296293
for _, path := range submitPaths {
297294
path, err := filepath.Abs(path)
298295
if err != nil {

cmd/submit_test.go

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -47,30 +47,6 @@ func TestSubmitWithoutWorkspace(t *testing.T) {
4747
}
4848
}
4949

50-
func TestSubmitWithoutArgs(t *testing.T) {
51-
tmpDir, err := ioutil.TempDir("", "submit-no-args")
52-
defer os.RemoveAll(tmpDir)
53-
assert.NoError(t, err)
54-
55-
v := viper.New()
56-
v.Set("token", "abc123")
57-
v.Set("workspace", tmpDir)
58-
v.Set("apibaseurl", "http://api.example.com")
59-
60-
cfg := config.Config{
61-
Persister: config.InMemoryPersister{},
62-
UserViperConfig: v,
63-
DefaultBaseURL: "http://example.com",
64-
}
65-
66-
var noCLIArguments []string
67-
68-
err = runSubmit(cfg, pflag.NewFlagSet("fake", pflag.PanicOnError), noCLIArguments)
69-
if assert.Error(t, err) {
70-
assert.Contains(t, err.Error(), "usage")
71-
}
72-
}
73-
7450
func TestSubmitNonExistentFile(t *testing.T) {
7551
tmpDir, err := ioutil.TempDir("", "submit-no-such-file")
7652
defer os.RemoveAll(tmpDir)

0 commit comments

Comments
 (0)