Created
October 26, 2025 18:42
-
-
Save baldwindavid/4b5e8548376fcaec1f84fec3534217cf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| # Usage: go_test_package.sh <file> | |
| # Runs all tests in the package containing the file | |
| input="${1:-}" | |
| if [[ -z "$input" ]]; then | |
| echo "Error: No file provided" | |
| exit 1 | |
| fi | |
| # Validate file exists | |
| if [[ ! -f "$input" ]]; then | |
| echo "Error: File not found: $input" | |
| exit 1 | |
| fi | |
| # Get the directory of the file (the package directory) | |
| package_dir=$(dirname "$input") | |
| # Change to the package directory and run all tests | |
| cd "$package_dir" | |
| # Run all tests in the package with gotestsum testdox format | |
| # Always exit 0 so Helix shows the output even on test failures | |
| gotestsum --format testdox || true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment