utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckEnv

func CheckEnv(appname string) (apppath, packpath string, err error)

func CloseFile

func CloseFile(f *os.File)

CloseFile attempts to close the passed file or panics with the actual error

func GetGOPATHs

func GetGOPATHs() []string

GetGOPATHs returns all paths in GOPATH variable.

func IsExist

func IsExist(path string) bool

IsExist returns whether a file or directory exists.

func IsInGOPATH

func IsInGOPATH(thePath string) bool

IsInGOPATH checks whether the path is inside of any GOPATH or not

func MustCheck

func MustCheck(err error)

MustCheck panics when the error is not nil

func ToCamel

func ToCamel(s string) string

Converts a string to CamelCase

func ToLowerCamel

func ToLowerCamel(s string) string

Converts a string to lowerCamelCase

func WriteToFile

func WriteToFile(filename, content string)

WriteToFile creates a file and writes content to it

Types

type FormatData

type FormatData struct {
	PkgName string
	Name    string
}

Jump to

Keyboard shortcuts

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