Version: v2.0.1+incompatible Latest Latest

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

Go to latest
Published: Jun 24, 2015 License: MIT Imports: 15 Imported by: 0



Package util contains general purpose utility and logging functions.



This section is empty.


View Source
var LogWriter io.Writer

LogWriter is the writer to which the logs are written


func Debug

func Debug(group string, format string, any ...interface{})

Debug writes a debug statement to stdout.

func Deprecate added in v1.3.1

func Deprecate(message string)

Deprecate writes a deprecation warning.

func Error

func Error(group string, format string, any ...interface{}) error

Error writes an error statement to stdout.

func FileExists

func FileExists(filename string) bool

FileExists determines if path exists

func FindUp

func FindUp(start, path string) string

FindUp finds a path up the tree. On sucess, it returns found path, else "".

func Info

func Info(group string, format string, any ...interface{})

Info writes an info statement to stdout.

func Outdated

func Outdated(srcGlobs, destGlobs []string) bool

Outdated determines if ANY src has been modified after ANY dest.

For example: *.go.html -> *.go

If any go.html has changed then generate go files.

func PackageName

func PackageName(sourceFile string) (string, error)

PackageName determines the package name from sourceFile if it is within $GOPATH

func Panic

func Panic(group string, format string, any ...interface{})

Panic writes an error statement to stdout.

func PartitionKV

func PartitionKV(r io.Reader, prefix string, assignment string) ([]map[string]string, error)

PartitionKV partitions a reader then parses key-value meta using an assignment string.



--@ key=SelectUser
SELECT * FROM users;

`, "--@", "=") => [{"_kind": "key", "key": "SelectUser", "_body": "SELECT * FROM users;"}]

func Prompt

func Prompt(prompt string) string

Prompt prompts user for input with default value.

func PromptPassword

func PromptPassword(prompt string) string

PromptPassword prompts user for password input.

func StrTemplate added in v1.4.3

func StrTemplate(src string, data map[string]interface{}) (string, error)

StrTemplate reads a go template and writes it to dist given data.

func Template

func Template(src string, dest string, data map[string]interface{})

Template reads a go template and writes it to dist given data.


This section is empty.

Jump to

Keyboard shortcuts

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