Skip to content

ci: add gofmt, vet, build and test gate - #33

Open
prakashUXtech wants to merge 1 commit into
mainfrom
chore/ci-gate
Open

prakashUXtech wants to merge 1 commit into
mainfrom
chore/ci-gate

Conversation

@prakashUXtech

Copy link
Copy Markdown
Contributor

This repo had no workflows at all, so nothing checked formatting, vet, build or tests when a PR opened.

The workflow runs four steps on every PR and on pushes to main: gofmt, go vet, go build, go test.

I ran each one against origin/main before adding it, so the gate passes on arrival instead of landing red and teaching everyone to ignore CI:

step result on origin/main
gofmt 7 files unformatted
go vet clean
go build clean
go test passing

The seven gofmt files are fixed by gofmt -w in the same commit so the gate starts green. That part of the diff is whitespace only: git diff -w against the parent is empty, and the tests still pass after reformatting.

It uses the Go toolchain's own checks rather than golangci-lint, so there is nothing extra to install or pin. golangci-lint is a reasonable follow-up, but it should be measured the same way first, since it will almost certainly report findings that need triaging before it can gate anything.

This repo had no workflows, so nothing checked formatting, vet, build or
tests on a pull request.

Each step was measured against origin/main before being added, so the gate
starts green instead of red:
vet, build and tests were already clean; gofmt flagged 7 files, fixed by
gofmt -w here. That diff is whitespace only — git diff -w against the
parent is empty.

Sticks to the Go toolchain's own checks rather than a third-party linter,
so there's nothing extra to install or keep pinned.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant