gox

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package gox for basic go utils

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentGoroutineId

func CurrentGoroutineId() int64

CurrentGoroutineId get current goroutine id by walk stack. This func get goroutine id by parse current stack string, call this function is expensive.

func ForceCast

func ForceCast[S any, T any](v S) T

ForceCast force cast value to another type. The two type must have same size.

func IsType

func IsType[T any](value any) bool

IsType return true if an interface is type T

func Max

func Max[T constraints.Ordered](v1, v2 T) T

Max return the max value

func Min

func Min[T constraints.Ordered](v1, v2 T) T

Min return the min value

func SizeOf

func SizeOf[T any]() uintptr

SizeOf return size of type T

func Zero

func Zero[T any]() (value T)

Zero return zero value for type T

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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