package utils
import "gorm.io/gorm/utils"
Index ¶
- func AssertEqual(x, y interface{}) bool
- func CallerFrame() runtime.Frame
- func CheckTruth(vals ...string) bool
- func Contains(elems []string, elem string) bool
- func FileWithLineNum() string
- func IsInvalidDBNameChar(c rune) bool
- func JoinNestedRelationNames(relationNames []string) string
- func NestedRelationName(prefix, name string) string
- func RTrimSlice[T any](v []T, trimLen int) []T
- func SplitNestedRelationName(name string) []string
- func ToString(value interface{}) string
- func ToStringKey(values ...interface{}) string
Functions ¶
func AssertEqual ¶
func AssertEqual(x, y interface{}) bool
func CallerFrame ¶
CallerFrame retrieves the first relevant stack frame outside of GORM's internal implementation files. It skips:
- GORM's core source files (identified by gormSourceDir prefix)
- Exclude test files (*_test.go)
- go-gorm/gen's Generated files (*.gen.go)
func CheckTruth ¶
CheckTruth check string true or not
func Contains ¶
func FileWithLineNum ¶
func FileWithLineNum() string
FileWithLineNum return the file name and line number of the current file
func IsInvalidDBNameChar ¶
func JoinNestedRelationNames ¶
JoinNestedRelationNames nested relationships like `Manager__Company`
func NestedRelationName ¶
NestedRelationName nested relationships like `Manager__Company`
func RTrimSlice ¶
RTrimSlice Right trims the given slice by given length
func SplitNestedRelationName ¶
SplitNestedRelationName Split nested relationships to `[]string{"Manager","Company"}`
func ToString ¶
func ToString(value interface{}) string
func ToStringKey ¶
func ToStringKey(values ...interface{}) string
Source Files ¶
utils.go
Directories ¶
| Path | Synopsis |
|---|---|
| utils/tests |
- Version
- v1.31.1 (latest)
- Published
- Nov 2, 2025
- Platform
- linux/amd64
- Imports
- 8 packages
- Last checked
- 2 months ago –
Tools for package owners.