utils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: LGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDirectory

func CreateDirectory(dirName string) error

CreateDirectory checks if a directory exists and if not creates it taken from https://www.socketloop.com/tutorials/golang-check-if-directory-exist-and-create-if-does-not-exist

func DeleteEmpty

func DeleteEmpty(s []string) []string

https://dabase.com/e/15006/

func GetAPIData

func GetAPIData(url string) (*http.Response, error)

GetAPIData wraps the get request

func ParseJSON

func ParseJSON(body []byte, i interface{}) error

ParseJSON parses byte slice body into struct i

func ParseResponse

func ParseResponse(resp *http.Response) ([]byte, error)

ParseResponse wraps ioutil.Readall

func StringInSlice

func StringInSlice(a string, list []string) bool

func StructPrint

func StructPrint(v interface{})

StructPrint prints out the structure of a Struct

func WrapError

func WrapError(e error)

WrapError wraps an error

Types

This section is empty.

Jump to

Keyboard shortcuts

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