folderutil

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: MIT Imports: 5 Imported by: 0

README

folderutil

The package contains various helpers to interact with folders

Documentation

Index

Constants

View Source
const (
	UnixPathSeparator    = "/"
	WindowsPathSeparator = "\\"
)

Variables

View Source
var Separator = string(os.PathSeparator)

Separator evaluated at runtime

Functions

func GetFiles

func GetFiles(root string) ([]string, error)

GetFiles within a folder

func HomeDirOrDefault

func HomeDirOrDefault(defaultDirectory string) string

HomeDirectory

func IsUnixOS

func IsUnixOS() bool

func IsWindowsOS

func IsWindowsOS() bool

Types

type PathInfo

type PathInfo struct {
	IsAbsolute         bool
	RootPath           string
	Parts              []string
	PartsWithSeparator []string
}

PathInfo about a folder

func NewPathInfo

func NewPathInfo(path string) (PathInfo, error)

NewPathInfo returns info about a given path

func (PathInfo) MeshWith

func (pathInfo PathInfo) MeshWith(anotherPath string) ([]string, error)

MeshWith combine all values from Path with another provided path

func (PathInfo) Paths

func (pathInfo PathInfo) Paths() ([]string, error)

Returns all possible combination of the various levels of the path parts

Jump to

Keyboard shortcuts

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