internal: add gofmt, goimports, copyright checks to CI

Relevant: #1190

Change-Id: Ib9a7db18bdca52459a0fcc435f8b52051ce9c9fd
Reviewed-on: https://code-review.googlesource.com/c/34495
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Eno Compton <enocom@google.com>
diff --git a/datastore/save.go b/datastore/save.go
index 5cd91d2..805a879 100644
--- a/datastore/save.go
+++ b/datastore/save.go
@@ -1,4 +1,4 @@
-// Copyright 4 Google LLC
+// Copyright 2014 Google LLC
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
diff --git a/internal/kokoro/vet.sh b/internal/kokoro/vet.sh
index 5650e9a..cce12ad 100755
--- a/internal/kokoro/vet.sh
+++ b/internal/kokoro/vet.sh
@@ -12,7 +12,15 @@
     exit 0
 fi
 
-go get -u golang.org/x/lint/golint
+go get -u \
+  golang.org/x/lint/golint \
+  golang.org/x/tools/cmd/goimports \
+  golang.org/x/lint/golint
+
+# Look at all .go files (ignoring .pb.go files) and make sure they have a Copyright. Fail if any don't.
+git ls-files "*[^.pb].go" | xargs grep -L "\(Copyright [0-9]\{4,\}\)" 2>&1 | tee /dev/stderr | (! read)
+gofmt -s -d -l . 2>&1 | tee /dev/stderr | (! read)
+goimports -l . 2>&1 | tee /dev/stderr | (! read)
 
 # Runs the linter. Regrettably the linter is very simple and does not provide the ability to exclude rules or files,
 # so we rely on inverse grepping to do this for us.