giteabot backport / giteabot (push) Canceled after 0s
giteabot / giteabot (push) Canceled after 0s
release-nightly / nightly-binary (push) Canceled after 0s
release-nightly / nightly-container (push) Canceled after 0s
cache-seeder / gobuild (push) Canceled after 0s
cache-seeder / lint (bindata, lint-backend) (push) Canceled after 0s
release-nightly-snapcraft / build-and-publish (push) Canceled after 0s
Includes direct password setup links in registration emails. Assisted-by: Codex:GPT-5
14 lines
290 B
Go
14 lines
290 B
Go
// Copyright 2025 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package util
|
|
|
|
func GetMapValueOrDefault[T any](m map[string]any, key string, defaultValue T) T {
|
|
if value, ok := m[key]; ok {
|
|
if v, ok := value.(T); ok {
|
|
return v
|
|
}
|
|
}
|
|
return defaultValue
|
|
}
|