Skip to content
This repository was archived by the owner on Jan 29, 2025. It is now read-only.

Commit f395b92

Browse files
killianmuldoontogashidm
authored andcommitted
Add goimports and gofmt check to the static analysis
Gofmt and Goimports should be run on each new PR in order to ensure there is no future drift from basic go formatting directives. These checks will simply fail if the code is not correctly formatted.
1 parent 2e50bef commit f395b92

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

.github/workflows/static-analysis.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ jobs:
2323
- uses: brpaz/hadolint-action@v1.2.1
2424
with:
2525
dockerfile: deploy/images/Dockerfile
26+
gofmt-imports:
27+
runs-on: ubuntu-latest
28+
name: Go Fmt and Go Import
29+
steps:
30+
- uses: actions/checkout@v2
31+
- uses: actions/setup-go@v2
32+
with:
33+
go-version: 1.15
34+
- run: go get golang.org/x/tools/cmd/goimports; test -z $(goimports -l .) && test -z $(gofmt -l .)
2635
golangci:
2736
strategy:
2837
matrix:

cmd/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"flag"
55
"log"
66
"os"
7+
78
"os/signal"
89
"syscall"
910
"time"
@@ -12,6 +13,7 @@ import (
1213
"github.com/intel/telemetry-aware-scheduling/pkg/metrics"
1314
"github.com/intel/telemetry-aware-scheduling/pkg/scheduler"
1415
strategy "github.com/intel/telemetry-aware-scheduling/pkg/strategies/core"
16+
1517
"github.com/intel/telemetry-aware-scheduling/pkg/strategies/deschedule"
1618
"github.com/intel/telemetry-aware-scheduling/pkg/strategies/dontschedule"
1719
"github.com/intel/telemetry-aware-scheduling/pkg/strategies/scheduleonmetric"

0 commit comments

Comments
 (0)