gobrick

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2019 License: MIT Imports: 8 Imported by: 2

README

gobrick

Simple Utilities in Go

Build Status Coverage Status Go Report Card License Release

Pow ``

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckErr

func CheckErr(e error, v ...interface{})

CheckErr takes an error and an optional list of things, and if the error exists logs the error and the string values for the things and then exits the program. Not sure if this is a good thing or not.

func FileInGoPath

func FileInGoPath(relativePath string) (*os.File, error)

FileInGoPath returns a file from the full path from the system's GOPATH of the passed in relative path value.

func FilePathInGoPath

func FilePathInGoPath(relativePath string) string

FilePathInGoPath returns a full path from the system's GOPATH of the passed in relative path value. TODO: Support for multiple GOPATHs

func GetGOPATH

func GetGOPATH() string

GetGOPATH returns the value of the GOPATH variable if set, and if not returns the default GOPATH.

func OpenBrowser

func OpenBrowser(url string) error

OpenBrowser opens up a browser in the underlying operating system at the given URL.

func ToJSON added in v1.0.0

func ToJSON(v interface{}) string

ToJSON takes in an entity and returns a formatted JSON string.

func ToJSONBytes added in v1.0.0

func ToJSONBytes(v interface{}) []byte

ToJSONBytes takes in an entity and returns formatted JSON as a byte array.

Types

type ExecCommand

type ExecCommand struct {
	Name string
	Args []string
}

ExecCommand is a struct used to hold the command values passed to exec.Command()

Jump to

Keyboard shortcuts

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