util

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 27, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProjectRoot string

Functions

func ConvertToInt

func ConvertToInt[T int | int64](s string) T

ConvertToInt преобразует строку в целое число

func DeepCopy

func DeepCopy[T any](from *T) (*T, error)

DeepCopy копирует любую структуру, про ограничения: "doc/COPY.md"

func Distinct

func Distinct(a []string) []string

Distinct возвращает уникальные элементы из массива строк

func GetConfigOptions

func GetConfigOptions() viper.DecoderConfigOption

GetConfigOptions Настраиваем декодирование

func GetCurrDir

func GetCurrDir() string

func GetCurrentDate

func GetCurrentDate() string

GetCurrentDate возвращает текущую дату в формате YYYY-MM-DD

func GetFlag

func GetFlag(name string) *string

func HasFlag

func HasFlag(name string) bool

func MakeDir

func MakeDir(dir string)

func MaskPhoneNumber

func MaskPhoneNumber(phone string) string

maskPhoneNumber маскирует номер телефона, заменяя 5 цифр перед последними двумя Например, +7 926 111 22 33 становится +7926*****33

func NewFuncWithIndex

func NewFuncWithIndex(prefix string) func() string

func RemoveDir

func RemoveDir(dir string)

func RuneCountForUTF16

func RuneCountForUTF16(s string) int

RuneCountForUTF16 возвращает количество символов в строке, учитывая UTF-16

func SimpleCopy

func SimpleCopy[T any](from *T) *T

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL