Skip to content

chore: execute goimports to format the code#740

Open
xibeiyoumian wants to merge 1 commit intors:masterfrom
xibeiyoumian:master
Open

chore: execute goimports to format the code#740
xibeiyoumian wants to merge 1 commit intors:masterfrom
xibeiyoumian:master

Conversation

@xibeiyoumian
Copy link

execute goimports to format the code

Signed-off-by: xibeiyoumian <xibeiyoumian@outlook.com>
@rs
Copy link
Owner

rs commented Dec 23, 2025

Please check failed tests

@rs rs requested a review from Copilot December 23, 2025 15:28
Copy link

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

This PR updates build constraints across multiple Go files to use the modern //go:build directive format (introduced in Go 1.17) while maintaining backward compatibility with the legacy // +build format. The changes also include minor formatting improvements such as adding blank lines between imports and removing extraneous blank lines from comments.

Key Changes

  • Added //go:build directives to all files that previously only had legacy // +build constraints
  • Standardized the format of build constraints to use && syntax instead of multiple separate lines
  • Added blank line separation in import blocks per Go formatting conventions

Reviewed changes

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

Show a summary per file
File Description
syslog_test.go Updated build constraints from separate lines to combined //go:build format
syslog.go Updated build constraints from separate lines to combined //go:build format
pkgerrors/stacktrace_test.go Added //go:build directive for binary_log constraint
not_go112.go Added //go:build directive for go version constraint
log_example_test.go Added //go:build directive for binary_log constraint
journald/journald_test.go Added //go:build directive for linux platform constraint
internal/cbor/types_64_test.go Added //go:build directive for architecture constraint
hlog/hlog_example_test.go Added //go:build directive for binary_log constraint
go112.go Added //go:build directive for go version constraint
event_test.go Added //go:build directive for binary_log constraint
encoder_json.go Added //go:build directive and blank line in imports
encoder_cbor.go Added //go:build directive for binary_log constraint
diode/diode_example_test.go Added //go:build directive for binary_log constraint
ctx.go Removed trailing blank line from comment block

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// +build !binary_log
// +build !windows
//go:build !binary_log && !windows
// +build !binary_log,!windows
Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

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

The legacy build constraint uses commas between conditions, which means OR in legacy syntax, but the new //go:build directive uses && for AND. These should match - use // +build !binary_log and // +build !windows on separate lines to match the AND logic of the //go:build directive.

Suggested change
// +build !binary_log,!windows
// +build !binary_log
// +build !windows

Copilot uses AI. Check for mistakes.
// +build !windows
// +build !binary_log
//go:build !windows && !binary_log
// +build !windows,!binary_log
Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

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

The legacy build constraint uses commas between conditions, which means OR in legacy syntax, but the new //go:build directive uses && for AND. These should match - use // +build !windows and // +build !binary_log on separate lines to match the AND logic of the //go:build directive.

Suggested change
// +build !windows,!binary_log
// +build !windows
// +build !binary_log

Copilot uses AI. Check for mistakes.
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.

3 participants