Currently as i know, goimports dont have an option to exclude specific directory so i am excluding vendor directory on my personal projects like below:
for item in $(find . -type f -name '*.go' -not -path './vendor/*'); do goimports -l -w $item; done
it is a little bit uggly i guess, so i and i think lots of gophers like me will be glad if that option is supported by goimports.