Skip to content

Commit

Permalink
Add lint commands to pre-commit githook
Browse files Browse the repository at this point in the history
- fix server exported function doc comment
  • Loading branch information
GradeyCullins committed Nov 14, 2023
1 parent 0ef45e5 commit 798b522
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,14 @@ if ! make test; then
echo "Please fix tests before committing."
exit 1
fi

if ! staticcheck ./...; then
echo "fix lint issues"
exit 1
fi

# Check for shadowed vars
if ! go vet -vettool=$(which shadow); then
echo "fix shadowed var issues"
exit 1
fi
2 changes: 1 addition & 1 deletion src/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (ah appHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
}

// Init intializes the Serve instance and exposes it based on the port parameter.
// InitServer intializes an HTTP server and registers listeners.
func InitServer() {
var portFlag int

Expand Down

0 comments on commit 798b522

Please sign in to comment.