bin/fmt: Use sort -u instead of sort | uniq (#4418)

No need to pipe output to another program when the functionality
exists in sort.

Signed-off-by: Joakim Roubert <joakimr@axis.com>
This commit is contained in:
Joakim Roubert 2020-05-18 18:52:53 +02:00 committed by GitHub
parent 659756e93f
commit 1e8bfed83f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -8,7 +8,7 @@ dirs=$(go list -f \{\{.Dir\}\} ./... | grep -v controller/gen)
# go list will list all subdirectories and goimports acts recursively. This
# results in certain files being reported multiple time. Therefore, we must
# dedup them.
files=$(bin/goimports -l $dirs | sort | uniq)
files=$(bin/goimports -l $dirs | sort -u)
if [ -n "$files" ]; then
for file in $files; do