util

package
v1.1.40 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(file string) (*os.File, error)

Creates or truncates the named file,if the file path contains directories, it will make them first.

func FileExists

func FileExists(file string) bool

FileExists checks whether a file exists.

func FileExistsOrCreate

func FileExistsOrCreate(dir string) error

文件是否存在,不存递归创建文件夹

func GetModule

func GetModule() string

func GetPbFiles

func GetPbFiles(pbFile string) []string

func GetProtoFiles

func GetProtoFiles(protoFile string) []string

func GetSwaggerFiles

func GetSwaggerFiles(swaggerFile string) []string

func GoFormat

func GoFormat(file string) error

GoFormat formats go file in canonical gofmt style and fix import statements.

func OpenOrCreate

func OpenOrCreate(file string) (*os.File, error)

OpenOrCreate opens a file if it exists, otherwise creates it. If the file path contains directories, it will make them first.

Types

This section is empty.

Jump to

Keyboard shortcuts

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