Skip to content

Commit b336b6a

Browse files
committed
Remove validate
Unneeded as these checks already happen in the constructor and it's potentially confusing because there are other needsX validation methods
1 parent d5ffa73 commit b336b6a

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

cmd/download.go

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ func newDownload(flags *pflag.FlagSet, usrCfg *viper.Viper) (*download, error) {
226226
}
227227
}
228228

229-
return d, d.validate()
229+
return d, nil
230230
}
231231

232232
func (d download) url() string {
@@ -251,16 +251,6 @@ func (d download) buildQueryParams(url *netURL.URL) {
251251
url.RawQuery = query.Encode()
252252
}
253253

254-
func (d download) validate() error {
255-
if d.payload.Solution.ID == "" {
256-
return errors.New("download missing ID")
257-
}
258-
if d.payload.Error.Message != "" {
259-
return errors.New(d.payload.Error.Message)
260-
}
261-
return nil
262-
}
263-
264254
// needsSlugXorUUID checks the presence of slug XOR uuid.
265255
func (d download) needsSlugXorUUID() error {
266256
if d.slug != "" && d.uuid != "" || d.uuid == d.slug {

0 commit comments

Comments
 (0)