umisc

package
v0.0.0-...-76c535a Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Go programming helpers for common miscellaneous needs.

Index

Constants

This section is empty.

Variables

View Source
var (
	//	The string format used in LogError().
	LogErrorFormat = "%v"
)

Functions

func E

func E(msg string) error

func F

func F(thing interface{}) float64

func IfB

func IfB(cond, ifTrue, ifFalse bool) bool

Returns `ifTrue` if `cond` is `true`, otherwise returns `ifFalse`.

func IfF64

func IfF64(cond bool, ifTrue, ifFalse float64) float64

Returns `ifTrue` if `cond` is `true`, otherwise returns `ifFalse`.

func IfI

func IfI(cond bool, ifTrue, ifFalse int) int

Returns `ifTrue` if `cond` is `true`, otherwise returns `ifFalse`.

func IfI16

func IfI16(cond bool, ifTrue, ifFalse int16) int16

Returns `ifTrue` if `cond` is `true`, otherwise returns `ifFalse`.

func IfI32

func IfI32(cond bool, ifTrue, ifFalse int32) int32

Returns `ifTrue` if `cond` is `true`, otherwise returns `ifFalse`.

func IfI64

func IfI64(cond bool, ifTrue, ifFalse int64) int64

Returns `ifTrue` if `cond` is `true`, otherwise returns `ifFalse`.

func IfS

func IfS(cond bool, ifTrue string, ifFalse string) string

Returns `ifTrue` if `cond` is `true`, otherwise returns `ifFalse`.

func IfU32

func IfU32(cond bool, ifTrue, ifFalse uint32) uint32

Returns `ifTrue` if `cond` is `true`, otherwise returns `ifFalse`.

func IfU64

func IfU64(cond bool, ifTrue, ifFalse uint64) uint64

Returns `ifTrue` if `cond` is `true`, otherwise returns `ifFalse`.

func IfW

func IfW(cond bool, ifTrue, ifFalse io.Writer) io.Writer

Returns `ifTrue` if `cond` is `true`, otherwise returns `ifFalse`.

func IfX

func IfX(cond bool, ifTrue, ifFalse interface{}) interface{}

Returns `ifTrue` if `cond` is `true`, otherwise returns `ifFalse`.

func JsonDecodeFromFile

func JsonDecodeFromFile(fromfilepath string, into interface{}) (err error)

func JsonEncodeToFile

func JsonEncodeToFile(from interface{}, tofilepath string) (err error)

func LogError

func LogError(err error)

A convenience short-hand for `log.Println(fmt.Sprintf(LogErrorFormat, err))` if `err` isn't `nil`.

func ParseVersion

func ParseVersion(verstr string) (majorMinor [2]int, both float64)

Attempts to extract major and minor version components from a string that begins with a version number. Example: returns []int{3, 2} and float64(3.2) for a `verstr` that is `3.2.0 - Build 8.15.10.2761`.

func S

func S(thing interface{}) string

func Str

func Str(thing interface{}) string

func Strf

func Strf(format string, args ...interface{}) string

Types

This section is empty.

Directories

Path Synopsis
Spatial data types & helpers for use in 3D apps (AABB, Frustum, bounding volumes etc)
Spatial data types & helpers for use in 3D apps (AABB, Frustum, bounding volumes etc)
db
Go programming helpers for common database needs.
Go programming helpers for common database needs.
umgo
Go programming helpers for common MongoDB needs.
Go programming helpers for common MongoDB needs.
dev
go
hs
ps
Go programming helpers for common file-system needs.
Go programming helpers for common file-system needs.
Go programming helpers for various miscellaneous geo-computing needs.
Go programming helpers for various miscellaneous geo-computing needs.
Go programming helpers for common graphics and imaging needs.
Go programming helpers for common graphics and imaging needs.
Go programming helpers for common hashing needs.
Go programming helpers for common hashing needs.
Go programming helpers for common networking needs.
Go programming helpers for common networking needs.
Go programming helpers for common maths needs; plus vectors, matrices and quaternions.
Go programming helpers for common maths needs; plus vectors, matrices and quaternions.
Go programming helpers for common 'pseudo-generic' typed-slice needs.
Go programming helpers for common 'pseudo-generic' typed-slice needs.
Go programming helpers for common string-processing needs.
Go programming helpers for common string-processing needs.

Jump to

Keyboard shortcuts

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