Skip to content

Commit ff8e3ae

Browse files
committed
add golangci-lint to pipeline and fix lint issues
- Add golangci-lint-action to GitHub Actions workflow - Fix invoice state check in LND backend (use inv.State == SETTLED) - Handle unused fmt.Fprintf return value in handler
1 parent 8160ccb commit ff8e3ae

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

.github/workflows/go.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ jobs:
2121
with:
2222
go-version: '1.24'
2323

24+
- name: golangci-lint
25+
uses: golangci/golangci-lint-action@v6
26+
2427
- name: Build
2528
run: go build -v ./...
2629

pkg/lightning/lnd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,5 +111,5 @@ func (b *LNDBackend) VerifyPayment(ctx context.Context, paymentHash string) (boo
111111
if err != nil {
112112
return false, fmt.Errorf("LookupInvoice: %w", err)
113113
}
114-
return inv.Settled, nil
114+
return (inv.State == lnrpc.Invoice_SETTLED), nil
115115
}

pkg/proxy/handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
5858
h.log.Warn("invalid L402 credentials", "err", err, "path", r.URL.Path)
5959
w.Header().Set("Content-Type", "application/json")
6060
w.WriteHeader(http.StatusBadRequest)
61-
fmt.Fprintf(w, `{"error":%q}`, err.Error())
61+
_, _ = fmt.Fprintf(w, `{"error":%q}`, err.Error())
6262
return
6363
}
6464
if err := h.validateAuth(r, token, preimage); err == nil {

0 commit comments

Comments
 (0)