Skip to content

refactor: fix linter warnings#1175

Merged
a-h merged 11 commits intomainfrom
fix_lint_errors
Jun 3, 2025
Merged

refactor: fix linter warnings#1175
a-h merged 11 commits intomainfrom
fix_lint_errors

Conversation

@a-h
Copy link
Copy Markdown
Owner

@a-h a-h commented Jun 3, 2025

No description provided.

@a-h a-h requested a review from Copilot June 3, 2025 14:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Refactor to address linter warnings by making error handling explicit and updating module/toolchain versions.

  • Bump Go versions and toolchains in example go.mod files
  • Replace unchecked writes/defers with explicit error handling or intentional ignores
  • Add error checks to cleanup and resource-close operations across tests and commands

Reviewed Changes

Copilot reviewed 56 out of 56 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
examples/integration-chi/go.mod Bump Go version to 1.23.0 and toolchain to go1.24.3
examples/hello-world-static/main.go Import log and handle Render error
examples/hello-world-ssr/main.go Import log and handle ListenAndServe error
examples/external-libraries/go.mod Bump Go version to 1.23.0 and toolchain to go1.24.3
docs/docs/go.mod Flatten require block into individual lines
cmd/templ/main.go Ignore fmt.Fprint return values explicitly
cmd/templ/lspcmd/proxy/server.go Update to use params.Position and simplify defers
cmd/templ/lspcmd/main.go Wrap deferred Close calls to ignore errors
cmd/templ/imports/process_test.go Wrap RemoveAll in defer with error check
cmd/templ/generatecmd/testwatch/generate_test.go Use strings.ReplaceAll and handle Close in getPort
cmd/templ/generatecmd/test-eventhandler/eventhandler_test.go Simplify error unwrapping and tighten file cleanup
cmd/templ/generatecmd/symlink/symlink_test.go Wrap symlink cleanup in defer with error reporting
cmd/templ/generatecmd/run/testprogram/main.go Ignore Fprintf return value
cmd/templ/generatecmd/run/run_test.go Replace manual file creation with os.WriteFile; close response body explicitly
cmd/templ/generatecmd/proxy/proxy_test.go Check errors on gzip/brotli writer Close and response body
cmd/templ/generatecmd/proxy/proxy.go Wrap Body.Close calls to ignore errors
cmd/templ/generatecmd/main_test.go Wrap RemoveAll cleanup in defer with error logging
cmd/templ/generatecmd/eventhandler.go Replace dual defers with ordered render, flush, and close calls
cmd/templ/generatecmd/cmd.go Refine boolean condition and handle Setenv errors
cmd/templ/fmtcmd/main_test.go Change cleanup to return error and wrap in defer with logging
Comments suppressed due to low confidence (1)

cmd/templ/lspcmd/proxy/server.go:712

  • The nested TextDocumentIdentifier.URI assignment was removed, so the inner identifier remains stale. Re-add params.TextDocument.TextDocumentIdentifier.URI = goURI to keep the identifier in sync.
params.TextDocument.URI = goURI

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@a-h a-h merged commit 18dda56 into main Jun 3, 2025
9 checks passed
@a-h a-h deleted the fix_lint_errors branch June 4, 2025 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants