Skip to content

utils

import "go-cli-template/internal/utils"

Index

func ConfigPathGlobal

func ConfigPathGlobal() string

ConfigPathGlobal returns the default global config file path.

func ConfigPathLocal

func ConfigPathLocal(cwd string) string

ConfigPathLocal returns the local config file path for the given cwd.

func TimeAgo

func TimeAgo(t time.Time) string

TimeAgo returns a human-readable string representing how long ago the given time was.

func XDGCacheHome

func XDGCacheHome() string

XDGCacheHome returns the cache home directory with sensible defaults.

func XDGConfigHome

func XDGConfigHome() string

XDGConfigHome returns the config home directory with sensible defaults.

func XDGDataHome

func XDGDataHome() string

XDGDataHome returns the data home directory with sensible defaults.

Source

See internal/utils/ for implementation details.