File: format

package info (click to toggle)
golang-github-gophercloud-utils 0.0~git20231010.80377ec-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 816 kB
  • sloc: sh: 20; makefile: 7
file content (25 lines) | stat: -rwxr-xr-x 504 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env bash

goimports="goimports"

find_files() {
  find . -not \( \
      \( \
        -wholename './output' \
        -o -wholename './_output' \
        -o -wholename './_gopath' \
        -o -wholename './release' \
        -o -wholename './target' \
        -o -wholename '*/third_party/*' \
        -o -wholename '*/vendor/*' \
      \) -prune \
    \) -name '*.go'
}

find_files

diff=$(find_files | xargs ${goimports} -d -e 2>&1)
if [[ -n "${diff}" ]]; then
  echo "${diff}"
  exit 1
fi