Remove error returns from crypto random helpers and callers (#37240)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: wxiaoguang <2114189+wxiaoguang@users.noreply.github.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: silverwind <115237+silverwind@users.noreply.github.com>
This commit is contained in:
@@ -31,16 +31,13 @@ type PackageBlobUpload struct {
|
||||
|
||||
// CreateBlobUpload inserts a blob upload
|
||||
func CreateBlobUpload(ctx context.Context) (*PackageBlobUpload, error) {
|
||||
id, err := util.CryptoRandomString(25)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
id := util.CryptoRandomString(25)
|
||||
|
||||
pbu := &PackageBlobUpload{
|
||||
ID: strings.ToLower(id),
|
||||
}
|
||||
|
||||
_, err = db.GetEngine(ctx).Insert(pbu)
|
||||
_, err := db.GetEngine(ctx).Insert(pbu)
|
||||
return pbu, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user