utils

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

General utilities including utilities for unit testing

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertEquals

func AssertEquals(t *testing.T, context string, expected, result interface{})

func AssertErrorEquals

func AssertErrorEquals(t *testing.T, context string, expected, result interface{})

func AssertFalse

func AssertFalse(t *testing.T, context string, test bool)

func AssertNoError

func AssertNoError(t *testing.T, context string, err error)

func AssertTrue

func AssertTrue(t *testing.T, context string, test bool)

func JsonStack

func JsonStack(panicMsg interface{}, rawTrace []byte) string

Converts stack and panic message into JSON for readability on a single log line

func JsonStringify

func JsonStringify(data interface{}) string

Create a JSON string from an interface, or an empty string if it cannot be marshalled

func Slug

func Slug(s string) string

Create a slug (all lowercase and replacing character groups matching "[^a-z0-9]+" with single hyphen)

Types

This section is empty.

Jump to

Keyboard shortcuts

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