util

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package util provides small utility functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fetch

func Fetch(req *http.Request) ([]byte, error)

Fetch executes req and returns the body and error if any. An error is returned when resp.StatusCode >= 400 or ioutil.Readall(resp.body) fails.

func HandleError

func HandleError(err error)

HandleError exits the program if err is not nil and prints it.

func RedirectNull

func RedirectNull(files ...**os.File) func()

RedirectNull redirect files to the operating system's “null device”. The returned function restores this redirection.

Types

This section is empty.

Jump to

Keyboard shortcuts

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