Skip to content

Commit a0bad7c

Browse files
authored
chore(golangci-lint): enable format, import, and unused presets; disable depguard (#207)
Signed-off-by: Chris Gianelloni <[email protected]>
1 parent 88a422d commit a0bad7c

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

.golangci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ issues:
44
max-issues-per-linter: 0
55
max-same-issues: 0
66
linters:
7+
disable:
8+
- depguard
79
enable:
810
- errcheck
911
- gosimple
@@ -12,9 +14,15 @@ linters:
1214
- staticcheck
1315
- unused
1416
# Defaults above ours below
17+
- copyloopvar
18+
- usestdlibvars
19+
- whitespace
1520
presets:
1621
- bugs
22+
- format
23+
- import
1724
- performance
25+
- unused
1826
#linters-settings:
1927
# errcheck:
2028
# check-type-assertions: true

cmd/tx-submit-api-mirror/main.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@ import (
1919
"fmt"
2020
"os"
2121

22-
"go.uber.org/automaxprocs/maxprocs"
23-
2422
"github.com/blinklabs-io/tx-submit-api-mirror/internal/api"
2523
"github.com/blinklabs-io/tx-submit-api-mirror/internal/config"
2624
"github.com/blinklabs-io/tx-submit-api-mirror/internal/logging"
25+
"go.uber.org/automaxprocs/maxprocs"
2726
)
2827

2928
var cmdlineFlags struct {

internal/api/api.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,13 @@ import (
2828

2929
models "github.com/blinklabs-io/cardano-models"
3030
"github.com/blinklabs-io/gouroboros/ledger"
31+
"github.com/blinklabs-io/tx-submit-api-mirror/internal/config"
32+
"github.com/blinklabs-io/tx-submit-api-mirror/internal/logging"
3133
"github.com/fxamacker/cbor/v2"
3234
cors "github.com/gin-contrib/cors"
3335
ginzap "github.com/gin-contrib/zap"
3436
"github.com/gin-gonic/gin"
3537
maestro "github.com/maestro-org/go-sdk/client"
36-
37-
"github.com/blinklabs-io/tx-submit-api-mirror/internal/config"
38-
"github.com/blinklabs-io/tx-submit-api-mirror/internal/logging"
3938
)
4039

4140
func Start(cfg *config.Config) error {
@@ -186,7 +185,7 @@ func handleSubmitTx(c *gin.Context) {
186185
return
187186
}
188187
defer resp.Body.Close()
189-
if resp.StatusCode == 202 {
188+
if resp.StatusCode == http.StatusAccepted {
190189
logger.Infow(
191190
fmt.Sprintf(
192191
"successfully submitted transaction %s to backend %s",

internal/logging/logging.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@ import (
1818
"log"
1919
"time"
2020

21+
"github.com/blinklabs-io/tx-submit-api-mirror/internal/config"
2122
"go.uber.org/zap"
2223
"go.uber.org/zap/zapcore"
23-
24-
"github.com/blinklabs-io/tx-submit-api-mirror/internal/config"
2524
)
2625

2726
type Logger = zap.SugaredLogger

0 commit comments

Comments
 (0)