Browse Source

.github/workflows: add gofmt (goimports) check

Change-Id: Iceb3182827b9c65f28f0351e0e254abe4a95e4de
Signed-off-by: Brad Fitzpatrick <[email protected]>
Brad Fitzpatrick 3 years ago
parent
commit
7c671b0220
2 changed files with 7 additions and 0 deletions
  1. 3 0
      .github/workflows/staticcheck.yml
  2. 4 0
      internal/tooldeps/tooldeps.go

+ 3 - 0
.github/workflows/staticcheck.yml

@@ -21,6 +21,9 @@ jobs:
     - name: Check out code
       uses: actions/checkout@v3
 
+    - name: Run gofmt (goimports)
+      run: go run golang.org/x/tools/cmd/goimports -d --format-only .
+
     - name: Run go vet
       run: go vet ./...
 

+ 4 - 0
internal/tooldeps/tooldeps.go

@@ -2,8 +2,12 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build for_go_mod_tidy_only
+// +build for_go_mod_tidy_only
+
 package tooldeps
 
 import (
 	_ "github.com/tailscale/depaware/depaware"
+	_ "golang.org/x/tools/cmd/goimports"
 )