Skip to content

Commit

Permalink
build: add gofmt to format make target (#282)
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Gianelloni <[email protected]>
  • Loading branch information
wolf31o2 authored Dec 20, 2024
1 parent 84294fc commit a9462f8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ clean:

format: mod-tidy
go fmt ./...
gofmt -s -w $(GO_FILES)

golines:
golines -w --ignore-generated --chain-split-dots --max-len=80 --reformat-tags .
Expand Down
15 changes: 12 additions & 3 deletions internal/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,12 @@ func Start(cfg *config.Config) error {
// Configure CORS
corsConfig := cors.DefaultConfig()
corsConfig.AllowAllOrigins = true
corsConfig.AllowHeaders = []string{"hx-current-url","hx-request","hx-target","hx-trigger"}
corsConfig.AllowHeaders = []string{
"hx-current-url",
"hx-request",
"hx-target",
"hx-trigger",
}
router.Use(cors.New(corsConfig))
// Access logging
accessLogger := logging.GetAccessLogger()
Expand Down Expand Up @@ -143,8 +148,12 @@ func Start(cfg *config.Config) error {
_ = ginmetrics.GetMonitor().AddMetric(failureMetric)
_ = ginmetrics.GetMonitor().AddMetric(submittedMetric)
// Initialize metrics
_ = ginmetrics.GetMonitor().GetMetric("tx_submit_fail_count").SetGaugeValue(nil, 0.0)
_ = ginmetrics.GetMonitor().GetMetric("tx_submit_count").SetGaugeValue(nil, 0.0)
_ = ginmetrics.GetMonitor().
GetMetric("tx_submit_fail_count").
SetGaugeValue(nil, 0.0)
_ = ginmetrics.GetMonitor().
GetMetric("tx_submit_count").
SetGaugeValue(nil, 0.0)

// Start metrics listener
go func() {
Expand Down

0 comments on commit a9462f8

Please sign in to comment.