Skip to content

fix: remove unused fmt import and resolve non-constant format string …#19

Open
rockaxorb13 wants to merge 1 commit into
BiniWorld:binibftfrom
rockaxorb13:fix-logging-formatting
Open

fix: remove unused fmt import and resolve non-constant format string …#19
rockaxorb13 wants to merge 1 commit into
BiniWorld:binibftfrom
rockaxorb13:fix-logging-formatting

Conversation

@rockaxorb13

Copy link
Copy Markdown

Description

This pull request resolves a static analysis failure caused by non-constant format strings being passed into logrus.Warnf functions across the node and communicator modules.

Previously, error messages were wrapped in fmt.Sprintf before being passed to the logger, which violates Go 1.21 strict vet checks regarding dynamic format strings. This PR strips the redundant fmt.Sprintf wrappers, updates the format verbs to %v to safely handle error types, and removes the resulting orphaned fmt import.

Changes Made

  • Updated node.go to utilize native logrus formatting for all warning logs.
  • Updated communicator.go to utilize native logrus formatting.
  • Removed the unused fmt package import from communicator.go to ensure clean binary compilation.

Testing

  • Verified successful compilation via go build ./... with zero warnings.

…in logrus.Warnf

Signed-off-by: Aadityavardhan Singh <singhrashmi018@gmail.com>
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.

1 participant