osutils

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2025 License: MIT Imports: 10 Imported by: 43

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsProbablyGoRun added in v0.30.0

func IsProbablyGoRun() bool

IsProbablyGoRun loosely checks if the current program was started with "go run".

func LaunchURL added in v0.24.0

func LaunchURL(url string) error

LaunchURL attempts to open the provided url in the user's default browser.

It is platform dependent and it uses:

  • "open" on macOS
  • "rundll32" on Windows
  • "xdg-open" on everything else (Linux, FreeBSD, etc.)

func MoveDirContent

func MoveDirContent(src string, dest string, rootExclude ...string) error

MoveDirContent moves the src dir content, that is not listed in the exclude list, to dest dir (it will be created if missing).

The rootExclude argument is used to specify a list of src root entries to exclude.

Note that this method doesn't delete the old src dir.

It is an alternative to os.Rename() for the cases where we can't rename/delete the src dir (see https://github.com/pocketbase/pocketbase/issues/2519).

func YesNoPrompt added in v0.25.0

func YesNoPrompt(message string, fallback bool) bool

YesNoPrompt performs a console prompt that asks the user for Yes/No answer.

If the user just press Enter (aka. doesn't type anything) it returns the fallback value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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