gotoolbox

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: MIT Imports: 11 Imported by: 0

README

{name}

{description}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IsMuslLibc = sync.OnceValue(
	func() bool {
		out, err := os.ReadFile("/proc/self/maps")
		if err == nil {
			if muslRegex.Match(out) {
				return true
			}
		}

		lddPath, err := exec.LookPath("ldd")
		if err == nil {
			ldd, err := os.ReadFile(lddPath)
			if err == nil {
				if muslRegex.Match(ldd) {
					return true
				} else if gnuLibcRegex.Match(ldd) {
					return false
				}
			}

			lddVersion, err := exec.
				Command(lddPath, "--version").
				CombinedOutput()
			if err == nil {
				if muslRegex.Match(lddVersion) {
					return true
				} else if gnuLibcRegex.Match(lddVersion) {
					return false
				}
			}
		}

		return false
	},
)

IsMuslLibc returns true if the system is using musl libc.

Functions

func Exec

func Exec(binPath string)

func Fetch

func Fetch(url string) (*http.Response, error)

func FetchGitHubReleaseAsset

func FetchGitHubReleaseAsset(
	repo, version, asset string,
) (io.ReadCloser, error)

func GitHubReleaseAssetURL

func GitHubReleaseAssetURL(repo, version, asset string) string

func ResolveToolPath

func ResolveToolPath(binName string) string

func ToolCacheDir

func ToolCacheDir() string

Types

This section is empty.

Directories

Path Synopsis
dprint module
goreleaser module

Jump to

Keyboard shortcuts

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