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:
silverwind
2026-08-19 23:21:38 +02:00
parent 052bc4b496
commit c15e6e793b
15 changed files with 20 additions and 20 deletions
+1 -1
View File
@@ -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"
)
+2 -2
View File
@@ -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,
}
+2 -2
View File
@@ -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()
}
+1 -1
View File
@@ -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"
)