utils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2016 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MaxF32

func MaxF32(a float32, b float32) float32

func MaxInt

func MaxInt(a int, b int) int

func MaxU8

func MaxU8(a uint8, b uint8) uint8

func MinF32

func MinF32(a float32, b float32) float32

func MinInt

func MinInt(a int, b int) int

func MinU8

func MinU8(a uint8, b uint8) uint8

func MustNotError

func MustNotError(err error, msg string, args ...interface{})

Logs the error and message with Go's "log" package, but only if the error is not nil. For just MustNotError, you should copy this snippet instead of adding a dependency.

import "fmt"
import "log"

func MustNotError(err error, msg string, args ...interface{}) {
	if err != nil {
		msg = fmt.Sprintf(msg, args...)
		log.Fatalf("%s: %s", msg, err)
	}
}

Types

This section is empty.

Jump to

Keyboard shortcuts

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