From 7c671b0220a5a42303dd68c8b63a5baedcce885e Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Tue, 26 Jul 2022 09:20:53 -0700 Subject: [PATCH] .github/workflows: add gofmt (goimports) check Change-Id: Iceb3182827b9c65f28f0351e0e254abe4a95e4de Signed-off-by: Brad Fitzpatrick --- .github/workflows/staticcheck.yml | 3 +++ internal/tooldeps/tooldeps.go | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/.github/workflows/staticcheck.yml b/.github/workflows/staticcheck.yml index a1deb93b5..adf936d8a 100644 --- a/.github/workflows/staticcheck.yml +++ b/.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 ./... diff --git a/internal/tooldeps/tooldeps.go b/internal/tooldeps/tooldeps.go index babd897ae..92c25ff28 100644 --- a/internal/tooldeps/tooldeps.go +++ b/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" )