Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
464 B · 13 lines
Shell
1234567891011121314#!/usr/bin/env bashset -euo pipefail
# Format project-owned Go sources, including new ones not staged yet, but not# fetched subprojects (ignored). A tracked file may be deleted but not staged# yet while a separate checkpoint is committed.files=()while IFS= read -r -d '' path; do if [[ -f "$path" ]]; then files+=("$path"); fidone < <(git ls-files -z --cached --others --exclude-standard -- '*.go')if ((${#files[@]})); then gofmt "$@" "${files[@]}"fi