utils

package
v1.0.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2018 License: MIT Imports: 6 Imported by: 1

Documentation

Overview

Package utils contains a set of utility functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanFilePath

func CleanFilePath(filePath string) string

CleanFilePath cleans the file path for `.` and ensures that there are no `/` at the start and end of the string

func CopyFile

func CopyFile(src, dst string) (err error)

CopyFile copies a file, from: https://stackoverflow.com/a/21067803/1090482

func FilePaths

func FilePaths(ext string, dirPaths ...string) ([]string, error)

FilePaths returns all the file paths in dirPaths that have the given ext

func MkdirAll

func MkdirAll(path string) error

MkdirAll is a shorthand for os.MkdirAll

func SliceList

func SliceList(slice []string) string

SliceList converts a []string to a nicely formatted string ex. "Steve, Kate & Johnny"

func ToSimpleQuery

func ToSimpleQuery(queryMap map[string]string) string

ToSimpleQuery converts a map[string]string to a HTTP query string. Doesn't work for query strings with multiple levels,

func WriteFile

func WriteFile(path string, bytes []byte) error

WriteFile is a shorthand for ioutil.WriteFile

Types

This section is empty.

Jump to

Keyboard shortcuts

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