utils

package
v0.0.0-...-55c649e Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: Apache-2.0 Imports: 6 Imported by: 5

Documentation

Overview

Package utils exports generally useful functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckClose

func CheckClose(closer io.Closer, errMsgOnClose string, err *error)

CheckClose closes an io.Closer and checks its error. Useful for checking the errors on deferred Close() behaviors.

func QuoteForShell

func QuoteForShell(str string) string

QuoteForShell quotes a string for use in a bash shell.

func RunCommand

func RunCommand(args []string, dir string, env []string) error

RunCommand runs a command using exec.Command. The command runs in the working directory "dir" with environment "env" and outputs to stdout and stderr.

func StringSliceContains

func StringSliceContains(arr []string, elem string) bool

StringSliceContains returns "true" if elem is in arr, "false" otherwise.

Types

This section is empty.

Jump to

Keyboard shortcuts

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