util

package
v0.0.0-...-25a1aa9 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLocalIP

func GetLocalIP() (net.IP, error)

GetLocalIP returns the local IP

func GetModulePath

func GetModulePath(dir string) (string, error)

GetModulePath ets the path of the project containing go.mod upwards from the current directory.

func IsLocalIP

func IsLocalIP(ip string) (bool, error)

IsLocalIP checks whether the IP address is local

func UnsafeToBytes

func UnsafeToBytes(s string) []byte

UnsafeToBytes converts string to a byte slice without memory allocation.

Note it may break if string and/or slice header will change in the future go versions.

func UnsafeToString

func UnsafeToString(b []byte) string

UnsafeToString converts byte slice to a string without memory allocation. See https://groups.google.com/forum/#!msg/Golang-Nuts/ENgbUzYvCuU/90yGx7GUAgAJ .

Note it may break if string and/or slice header will change in the future go versions.

Types

This section is empty.

Jump to

Keyboard shortcuts

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