workdir

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefault

func GetDefault() string

GetDefault returns the default mount prefix from fixtures.

func IsValid

func IsValid(workdir string) error

IsValid checks if the provided workdir is valid.

A valid workdir must: - Be an absolute path. - Start with the mount prefix from fixtures.

Parameters:

  • workdir: The workdir path to validate.

Returns:

  • An error if the workdir is invalid; otherwise, nil.

func SetOrDefault

func SetOrDefault(workdir string) string

SetOrDefault returns the provided workdir if it is not empty; otherwise, it returns the default workdir.

Parameters:

  • workdir: The workdir path to validate.

Returns:

  • The provided workdir if it is not empty and starts with '/'.
  • The default workdir if the provided workdir is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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