mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-21 09:41:40 +02:00
chore: use stdlib uuid package
Go 1.27 ships a uuid package with the same API, dropping the direct dependency on github.com/google/uuid. Assisted-by: Claude:Opus 5
This commit is contained in:
@@ -21,9 +21,9 @@ import (
|
||||
"gitea.dev/modules/timeutil"
|
||||
"gitea.dev/modules/util"
|
||||
|
||||
uuid "github.com/google/uuid"
|
||||
"golang.org/x/crypto/bcrypt"
|
||||
"golang.org/x/oauth2"
|
||||
"uuid"
|
||||
"xorm.io/builder"
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
|
||||
@@ -17,7 +17,7 @@ import (
|
||||
"gitea.dev/modules/setting"
|
||||
"gitea.dev/modules/util"
|
||||
|
||||
gouuid "github.com/google/uuid"
|
||||
"uuid"
|
||||
)
|
||||
|
||||
// ErrUploadNotExist represents a "UploadNotExist" kind of error.
|
||||
@@ -60,7 +60,7 @@ func (upload *Upload) LocalPath() string {
|
||||
// NewUpload creates a new upload object.
|
||||
func NewUpload(ctx context.Context, name string, buf []byte, file multipart.File) (_ *Upload, err error) {
|
||||
upload := &Upload{
|
||||
UUID: gouuid.New().String(),
|
||||
UUID: uuid.New().String(),
|
||||
Name: name,
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import (
|
||||
"gitea.dev/modules/timeutil"
|
||||
webhook_module "gitea.dev/modules/webhook"
|
||||
|
||||
gouuid "github.com/google/uuid"
|
||||
"uuid"
|
||||
"xorm.io/builder"
|
||||
)
|
||||
|
||||
@@ -119,7 +119,7 @@ func HookTasks(ctx context.Context, hookID int64, page int) ([]*HookTask, error)
|
||||
// CreateHookTask creates a new hook task,
|
||||
// it handles conversion from Payload to PayloadContent.
|
||||
func CreateHookTask(ctx context.Context, t *HookTask) (*HookTask, error) {
|
||||
t.UUID = gouuid.New().String()
|
||||
t.UUID = uuid.New().String()
|
||||
if t.Delivered == 0 {
|
||||
t.Delivered = timeutil.TimeStampNanoNow()
|
||||
}
|
||||
|
||||
@@ -15,9 +15,9 @@ import (
|
||||
"gitea.dev/modules/timeutil"
|
||||
webhook_module "gitea.dev/modules/webhook"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"uuid"
|
||||
"xorm.io/builder"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user