utils

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(src, dst string) (int64, error)

Copy calls io.Copy if the source file and destination file exists

func FormatCode

func FormatCode(code string) string

func GenFile

func GenFile(c FileGenConfig) error

func GetParentPackage

func GetParentPackage(dir string) (string, error)

func MaybeCreateFile

func MaybeCreateFile(dir, subdir, file string) (fp *os.File, created bool, err error)

MaybeCreateFile creates file if not exists

func WrapErr

func WrapErr(err error, message string) error

WrapErr wraps an error with message

Types

type FileGenConfig

type FileGenConfig struct {
	Dir             string
	Subdir          string
	Filename        string
	TemplateName    string
	Category        string
	TemplateFile    string
	BuiltinTemplate string
	Data            interface{}
}

Jump to

Keyboard shortcuts

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