execx

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2026 License: MIT Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FreePort added in v0.2.0

func FreePort(port int)

FreePort releases a TCP port before a service binds to it, so two independent godev projects on the same machine (e.g. two microservices, each defaulting to :5432/:3000) don't have to coordinate port numbers by hand.

It first checks whether a Docker container — from this project or any other — is currently publishing that exact port, and if so stops just that one container (docker stop, never a teardown of its whole stack). Only when no container owns the port does it fall back to killing a bare local process on it, and even then it refuses to touch anything that looks like the container engine itself (see dockerEngineProcessNames).

func OpenBrowser

func OpenBrowser(target string)

OpenBrowser opens a file or URL in the default browser (preferring Google Chrome on Mac)

func Run

func Run(name string, args ...string) error

Run executes a command streaming stdout/stderr to standard OS outputs

func RunWithEnv

func RunWithEnv(env map[string]string, name string, args ...string) error

RunWithEnv executes a command with additional environment variables

func StartBackground

func StartBackground(ctx context.Context, env map[string]string, name string, args ...string) (*exec.Cmd, error)

StartBackground starts a long-running process in background with custom env and context

func WaitForURL

func WaitForURL(urlStr string, timeout time.Duration) error

WaitForURL polls an HTTP endpoint until it responds with a non-5xx status code or times out

Types

This section is empty.

Jump to

Keyboard shortcuts

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