Documentation ¶
Overview ¶
Package proj contains test utilities for dealing with project paths and the like. The sq project dir is accessed via the Dir function. When proj's init function returns, certain envars such as SQ_ROOT are guaranteed to be set. Thus the following will work as expected:
p := proj.Expand("${SQ_ROOT}/go.mod")
Index ¶
Constants ¶
const ( // EnvRoot is the name of the envar holding the path of // the sq project root. EnvRoot = "SQ_ROOT" // EnvPassw is the name of the envar holding the standard // password used for testing. EnvPassw = "SQ_PASSW" // DefaultPassw is the default password used for testing. DefaultPassw = "p_ssW0rd" EnvLogFile = "SQ_LOGFILE" )
Variables ¶
This section is empty.
Functions ¶
func Abs ¶
Abs returns the absolute path of projRelPath, where projRelPath is relative to the project dir.
func BoolEnvar ¶
BoolEnvar returns true if the environment variable e is set and its value is boolean true.
func Dir ¶
func Dir() string
Dir returns the absolute path to the root of the sq project, as set in envar EnvRoot or determined programmatically.
func Expand ¶
Expand wraps os.ExpandEnv. This function is preferred as it ensures that envar SQ_ROOT is set (via proj's init function).
func LogFile ¶
func LogFile() string
LogFile returns the path to sq's log file, as specified by EnvLogFile. If none set, the empty string is returned.
Types ¶
This section is empty.