Do not use goimports in hack/update-generated-conversions.sh

Stop depending on an external binary needing to be on people's system.
Use the code directly.
This commit is contained in:
Eric Paris
2015-08-13 17:07:00 -04:00
parent 00929ed7d8
commit 8f3577e5d2
4 changed files with 25 additions and 21 deletions

View File

@@ -33,26 +33,15 @@ function generate_version() {
sed 's/YEAR/2015/' hack/boilerplate/boilerplate.go.txt > "$TMPFILE"
cat >> "$TMPFILE" <<EOF
package ${version##*/}
// DO NOT EDIT. THIS FILE IS AUTO-GENERATED BY \$KUBEROOT/hack/update-generated-conversions.sh
// AUTO-GENERATED FUNCTIONS START HERE
EOF
"${genconversion}" -v "${version}" -f - >> "$TMPFILE"
cat >> "$TMPFILE" <<EOF
// AUTO-GENERATED FUNCTIONS END HERE
EOF
goimports -w "$TMPFILE"
mv "$TMPFILE" "pkg/${version}/conversion_generated.go"
}
if ! which goimports >/dev/null; then
echo "goimports not in path, run go get golang.org/x/tools/cmd/goimports"
exit 1
fi
DEFAULT_VERSIONS="api/v1 expapi/v1"
VERSIONS=${VERSIONS:-$DEFAULT_VERSIONS}
for ver in $VERSIONS; do