Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
issues:
exclude-dirs:
- docs
max-issues-per-linter: 0
max-same-issues: 0
linters:
enable:
- errcheck
- gosec
- gosimple
- govet
- ineffassign
- staticcheck
- unused
run:
issues-exit-code: 1
tests: false
timeout: 10m
6 changes: 3 additions & 3 deletions cmd/gouroboros/chainsync.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 Blink Labs Software
// Copyright 2025 Blink Labs Software
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -172,7 +172,7 @@ func testChainSync(f *globalFlags) {
}()
o, err := ouroboros.New(
ouroboros.WithConnection(conn),
ouroboros.WithNetworkMagic(uint32(f.networkMagic)),
ouroboros.WithNetworkMagic(uint32(f.networkMagic)), // #nosec G115
ouroboros.WithErrorChan(errorChan),
ouroboros.WithNodeToNode(f.ntnProto),
ouroboros.WithKeepAlive(true),
Expand All @@ -199,7 +199,7 @@ func testChainSync(f *globalFlags) {
point = tip.Point
} else if len(intersectPoint) > 0 {
// Slot
slot := uint64(intersectPoint[0].(int))
slot := uint64(intersectPoint[0].(int)) // #nosec G115
// Block hash
hash, _ := hex.DecodeString(intersectPoint[1].(string))
point = common.NewPoint(slot, hash)
Expand Down
4 changes: 2 additions & 2 deletions cmd/gouroboros/localtxsubmission.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023 Blink Labs Software
// Copyright 2025 Blink Labs Software
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -79,7 +79,7 @@ func testLocalTxSubmission(f *globalFlags) {
}()
o, err := ouroboros.New(
ouroboros.WithConnection(conn),
ouroboros.WithNetworkMagic(uint32(f.networkMagic)),
ouroboros.WithNetworkMagic(uint32(f.networkMagic)), // #nosec G115
ouroboros.WithErrorChan(errorChan),
ouroboros.WithNodeToNode(f.ntnProto),
ouroboros.WithKeepAlive(true),
Expand Down
8 changes: 6 additions & 2 deletions cmd/gouroboros/mem_usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ import (
"fmt"
"log"
"net/http"
_ "net/http/pprof"
"os"
"runtime"
"runtime/pprof"
"time"

// #nosec G108
_ "net/http/pprof"

ouroboros "github.com/blinklabs-io/gouroboros"
)

Expand Down Expand Up @@ -70,6 +72,8 @@ func testMemUsage(f *globalFlags) {
)
go func() {
log.Println(
// This is a test program, no timeouts
// #nosec G114
http.ListenAndServe(
fmt.Sprintf(":%d", memUsageFlags.debugPort),
nil,
Expand All @@ -94,7 +98,7 @@ func testMemUsage(f *globalFlags) {
}()
o, err := ouroboros.New(
ouroboros.WithConnection(conn),
ouroboros.WithNetworkMagic(uint32(f.networkMagic)),
ouroboros.WithNetworkMagic(uint32(f.networkMagic)), // #nosec G115
ouroboros.WithErrorChan(errorChan),
ouroboros.WithNodeToNode(f.ntnProto),
ouroboros.WithKeepAlive(true),
Expand Down
2 changes: 1 addition & 1 deletion cmd/gouroboros/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func testQuery(f *globalFlags) {
}()
o, err := ouroboros.New(
ouroboros.WithConnection(conn),
ouroboros.WithNetworkMagic(uint32(f.networkMagic)),
ouroboros.WithNetworkMagic(uint32(f.networkMagic)), // #nosec G115
ouroboros.WithErrorChan(errorChan),
ouroboros.WithNodeToNode(f.ntnProto),
ouroboros.WithKeepAlive(true),
Expand Down
2 changes: 1 addition & 1 deletion cmd/gouroboros/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func testServer(f *globalFlags) {
}()
_, err = ouroboros.New(
ouroboros.WithConnection(conn),
ouroboros.WithNetworkMagic(uint32(f.networkMagic)),
ouroboros.WithNetworkMagic(uint32(f.networkMagic)), // #nosec G115
ouroboros.WithErrorChan(errorChan),
ouroboros.WithNodeToNode(f.ntnProto),
ouroboros.WithServer(true),
Expand Down
6 changes: 3 additions & 3 deletions cmd/tx-submission/main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 Blink Labs Software
// Copyright 2025 Blink Labs Software
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -68,7 +68,7 @@ func main() {
}()
o, err := ouroboros.New(
ouroboros.WithConnection(conn),
ouroboros.WithNetworkMagic(uint32(f.NetworkMagic)),
ouroboros.WithNetworkMagic(uint32(f.NetworkMagic)), // #nosec G115
ouroboros.WithErrorChan(errorChan),
ouroboros.WithNodeToNode(f.NtnProto),
ouroboros.WithKeepAlive(true),
Expand Down Expand Up @@ -164,7 +164,7 @@ func handleRequestTxIds(
EraId: 5,
TxId: txHash,
},
Size: uint32(len(txBytes)),
Size: uint32(len(txBytes)), // #nosec G115
},
}
return ret, nil
Expand Down
2 changes: 1 addition & 1 deletion ledger/conway/conway.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ func (r ConwayRedeemers) Indexes(tag common.RedeemerTag) []uint {
func (r ConwayRedeemers) Value(index uint, tag common.RedeemerTag) (cbor.LazyValue, common.RedeemerExUnits) {
redeemer, ok := r.Redeemers[ConwayRedeemerKey{
Tag: tag,
Index: uint32(index),
Index: uint32(index), // #nosec G115
}]
if ok {
return redeemer.Data, redeemer.ExUnits
Expand Down
Loading