Skip to content

Commit d296636

Browse files
committed
Submission uses pointer receivers
Size can get large if submitting many docs
1 parent 9dd0499 commit d296636

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

cmd/submit.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ type submission struct {
296296
}
297297

298298
// submit submits the documents to the Exercism API.
299-
func (s submission) submit(usrCfg *viper.Viper) error {
299+
func (s *submission) submit(usrCfg *viper.Viper) error {
300300
if err := s.validate(); err != nil {
301301
return err
302302
}
@@ -358,7 +358,10 @@ func (s submission) submit(usrCfg *viper.Viper) error {
358358
return nil
359359
}
360360

361-
func (s submission) validate() error {
361+
func (s *submission) validate() error {
362+
if s == nil {
363+
return errors.New("submission is empty")
364+
}
362365
if s.metadata.ID == "" {
363366
return errors.New("id is empty")
364367
}

0 commit comments

Comments
 (0)