Alternative TLS implementation in Go
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

28 righe
729 B

  1. #!/bin/sh
  2. # Copyright 2012 The Go Authors. All rights reserved.
  3. # Use of this source code is governed by a BSD-style
  4. # license that can be found in the LICENSE file.
  5. # git gofmt pre-commit hook
  6. #
  7. # To use, store as .git/hooks/pre-commit inside your repository and make sure
  8. # it has execute permissions.
  9. #
  10. # This script does not handle file names that contain spaces.
  11. gofiles=$(git diff --cached --name-only --diff-filter=ACM | grep '\.go$')
  12. [ -z "$gofiles" ] && exit 0
  13. unformatted=$(gofmt -l $gofiles)
  14. [ -z "$unformatted" ] && exit 0
  15. # Some files are not gofmt'd. Print message and fail.
  16. echo >&2 "Go files must be formatted with gofmt. Please run:"
  17. for fn in $unformatted; do
  18. echo >&2 " gofmt -w $PWD/$fn"
  19. done
  20. exit 1