common

package
v1.30.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2018 License: Apache-2.0 Imports: 4 Imported by: 24

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Die

func Die(format string, values ...interface{})

Die is the same as Warn, but it quits with exit status 1 after printing a message.

func MapFilesToDirectories

func MapFilesToDirectories(files, dirs []string) []string

MapFilesToDirectories creates one entry for each file and directory passed. Result is a kind of cross-product. For files f1 and f2 and directories d1 and d2, the returned list will contain d1/f1 d2/f1 d1/f2 d2/f2.

The "files" part might be a bit misleading - you can pass a list of symlinks or directories there as well.

func MustAbs

func MustAbs(dir string) string

MustAbs returns an absolute path. It works like filepath.Abs, but panics if it fails.

func Warn

func Warn(format string, values ...interface{})

Warn is just a shorter version of a formatted printing to stderr. It appends a newline for you.

Types

type StringSliceWrapper

type StringSliceWrapper struct {
	Slice *[]string
}

StringSliceWrapper is an implementation of flag.Value interface. It is basically a proxy that appends strings to an already existing strings slice.

func (*StringSliceWrapper) Set

func (wrapper *StringSliceWrapper) Set(str string) error

func (*StringSliceWrapper) String

func (wrapper *StringSliceWrapper) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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