util

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2015 License: Apache-2.0 Imports: 4 Imported by: 14

Documentation

Overview

Package util provides various utility functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BaseName

func BaseName(s, suffix string) string

BaseName - as the basename Unix tool - deletes any prefix ending with the last slash character present in a string, and a suffix, if given.

func FileExist

func FileExist(name string) bool

FileExist reports whether a file or directory exists.

func InDir added in v0.7.0

func InDir(dir string, f func())

InDir runs a function inside a specific directory.

func InTestDir added in v0.7.0

func InTestDir(f func())

InTestDir runs the passed function inside a temporary directory, which will be removed afterwards. Use it for isolated testing.

func TempDir added in v0.5.0

func TempDir() (string, error)

TempDir creates a new temporary directory to be used by chef-runner.

Types

This section is empty.

Jump to

Keyboard shortcuts

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