Convert generated-deep-copies to use golang.org/x/tools/imports

I don't like users to need an external binary which can easily get out
of sync. Just include the tools.
This commit is contained in:
Eric Paris
2015-08-13 12:40:03 -04:00
parent 4acf86400f
commit 00929ed7d8
6 changed files with 34 additions and 29 deletions

View File

@@ -36,27 +36,14 @@ function generate_version() {
echo "Generating for ${version}"
# version is group/version, so use the version number as the package name unless
# this is an internal version, in which case use the group name.
pkgname=${version##*/}
if [[ -z $pkgname ]]; then
pkgname=${version%/*}
fi
sed 's/YEAR/2015/' hack/boilerplate/boilerplate.go.txt > $TMPFILE
cat >> $TMPFILE <<EOF
package $pkgname
// DO NOT EDIT. THIS FILE IS AUTO-GENERATED BY \$KUBEROOT/hack/update-generated-deep-copies.sh.
// AUTO-GENERATED FUNCTIONS START HERE
EOF
"${gendeepcopy}" -v "${version}" -f - -o "${version}=" >> "$TMPFILE"
cat >> "$TMPFILE" <<EOF
// AUTO-GENERATED FUNCTIONS END HERE
EOF
goimports -w "$TMPFILE"
mv "$TMPFILE" `result_file_name ${version}`
}