gormgorm.io/gorm/utils Index | Files | Directories

package utils

import "gorm.io/gorm/utils"

Index

Functions

func AssertEqual

func AssertEqual(x, y interface{}) bool

func CheckTruth

func CheckTruth(vals ...string) bool

CheckTruth check string true or not

func Contains

func Contains(elems []string, elem string) bool

func FileWithLineNum

func FileWithLineNum() string

FileWithLineNum return the file name and line number of the current file

func IsValidDBNameChar

func IsValidDBNameChar(c rune) bool

func JoinNestedRelationNames

func JoinNestedRelationNames(relationNames []string) string

JoinNestedRelationNames nested relationships like `Manager__Company`

func NestedRelationName

func NestedRelationName(prefix, name string) string

NestedRelationName nested relationships like `Manager__Company`

func RTrimSlice

func RTrimSlice[T any](v []T, trimLen int) []T

RTrimSlice Right trims the given slice by given length

func SplitNestedRelationName

func SplitNestedRelationName(name string) []string

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

PathSynopsis
utils/tests
Version
v1.26.1 (latest)
Published
May 7, 2025
Platform
linux/amd64
Imports
8 packages
Last checked
1 week ago

Tools for package owners.