FILE / ScuroNeko/Laniakea

utils.go

Исходный файл и его история в репозитории.
FILE 07ce1ccda07ffd2699401c8a9ca2b99f17436523
Files
Laniakea/utils.go
T
ScuroNeko 7205b21fa2
Golang lint / lint (pull_request) Successful in 7m10s
Golang lint / lint (push) Successful in 7m13s
(new): tgfmt package
(fix): formatting helpers
(ci/cd): go checks
(tests): tgfmt coverage
2026-05-04 11:20:09 +03:00

30 lines
749 B
Go

package laniakea
import (
"git.scuroneko.dev/scuroneko/laniakea/utils"
)
// Ptr returns a pointer to v.
func Ptr[T any](v T) *T { return &v }
// Val returns dereferenced pointer value or def when p is nil.
func Val[T any](p *T, def T) T {
if p != nil {
return *p
}
return def
}
const (
// VersionString re-exports the module version string.
VersionString = utils.VersionString
// VersionMajor re-exports the module major version.
VersionMajor = utils.VersionMajor
// VersionMinor re-exports the module minor version.
VersionMinor = utils.VersionMinor
// VersionPatch re-exports the module patch version.
VersionPatch = utils.VersionPatch
// VersionBeta re-exports the module prerelease counter.
VersionBeta = utils.VersionBeta
)