utils

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: MIT Imports: 11 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HostByteOrder binary.ByteOrder

HostByteOrder is the native byte order of the local CPU. Value is determined at run time.

View Source
var NetworkByteOrder binary.ByteOrder = binary.BigEndian

NetworkByteOrder is the byte order used on networks, defined by RFC1700

Functions

func BaseName

func BaseName(path string) string

BaseName returns the base name portion of a path.

func CompatibleType added in v1.3.0

func CompatibleType(v reflect.Value, t reflect.Type) bool

func ExecutableDir

func ExecutableDir() (string, error)

ExecutableDir returns the directory containing current executable.

func FormatPublicType

func FormatPublicType(name string) string

FormatPublicType returns a human-readable Golang public type name from an arbitrary non-empty string.

func GetStructTag added in v1.3.0

func GetStructTag(f reflect.StructField, tagName string) string

GetStructTag returns the value of a named tag of a struct member

func GetSystemDirectory

func GetSystemDirectory() (string, error)

GetSystemDirectory is not implemented on non-Windows OSes and always returns an error.

func IsImplicitRelativePath

func IsImplicitRelativePath(path string) bool

IsImplicitRelativePath tests if the path only contains a file name.

func PathsFromEnvironmentVariable added in v1.3.0

func PathsFromEnvironmentVariable(env string) []string

func PathsFromFileLines added in v1.3.0

func PathsFromFileLines(file string) (ret []string)

func Set added in v1.3.0

func Set(v reflect.Value, obj any)

func StringToUintPtr added in v1.3.0

func StringToUintPtr(s string) uintptr

func UintPtrToString

func UintPtrToString(ptr uintptr) string

UintPtrToString converts a zero-terminated raw "const char *" to a Go string. Example:

var str := utils.UintPtrToString(uintptr(unsafe.Pointer(uint16ptr_variable)))

Types

This section is empty.

Jump to

Keyboard shortcuts

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