files

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateFileAndFolders

func CreateFileAndFolders(filePath string) (*os.File, error)

CreateFileAndFolders creates a file and the necessary folders if they don't exist.

func FindFile

func FindFile(childDir, fileName string) (string, error)

FindFile searches for the specified file in the given directory and its parent directories.

func GenerateOutputFileName

func GenerateOutputFileName(input, output string) string

func GetPackagePath

func GetPackagePath(goModPath string, modFile *modfile.File, filename string) (string, error)

GetPackagePath returns the absolute path of the file package, including the module path. This function is not considering packages with different names from their respective folders, the reason is that this software is not made for psychopaths.

func GetRelativePath added in v0.3.1

func GetRelativePath(path1, path2 string) (string, error)

GetRelativePath returns the shared path between two paths. if they are in the same folder, they will return the same folder path. Example: /path1/folder1/file and /path1/folder2/file2 should return /path1.

func ListGoFiles

func ListGoFiles(dirs, ignore []string) ([]string, error)

ListGoFiles lists all Go files under a directory.

Types

This section is empty.

Jump to

Keyboard shortcuts

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