util

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2016 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPrefix

func AddPrefix(inSlice []string, prefix string) []string

AddPrefix takes a string slice and returns a new string slice with the supplied prefix inserted before every string in the original slice.

func DeleteFile added in v1.0.4

func DeleteFile(filename string)

DeleteFile deletes a file.

func ExtractFileExtension

func ExtractFileExtension(filename string) string

ExtractFileExtension extracts the extension from a filename. This is defined as the remainder of the string after the last '.'.

func JoinStringSlices

func JoinStringSlices(slices ...[]string) []string

JoinStringSlices takes an arbitrary number of string slices and concatenates them in the order supplied.

func ReadStdin added in v1.0.4

func ReadStdin(promptMessage string, completeMessage string) []string

ReadStdin takes a prompt message and

func RetrievePath added in v1.0.4

func RetrievePath(targetDirs []string) string

RetrievePath takes an array whose first element may contain an overridden path and converts either this, or the default of "." to an absolute path using Go's file utilities. This is then passed to SanitisedPath with the current OS to get it into a Docker ready format.

func SanitisePath added in v1.0.4

func SanitisePath(path string, platform string) string

SanitisePath takes an absolute path as provided by filepath.Abs() and makes it ready to be passed to Docker based on the current OS. So far the only OS format that requires transforming is Windows which is provided in the form 'C:\some\path' but Docker requires '/c/some/path'.

func WriteFile added in v1.0.4

func WriteFile(filename string, content []byte)

WriteFile writes a file.

Types

This section is empty.

Jump to

Keyboard shortcuts

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