Skip to content

Refactor: make minUsagePadding a constant #2323

@htoyoda18

Description

@htoyoda18

Summary

The variable minUsagePadding is currently defined as a package-level variable, but it represents a fixed configuration value that never changes at runtime.
It would be more idiomatic and safer in Go to define it as a constant.

Current Code

var minUsagePadding = 25

Proposed Change

Change it to:

const minUsagePadding = 25

Rationale

  • The value is immutable and conceptually a compile-time constant.
  • Using const makes the intention clearer to readers and contributors.
  • It prevents any accidental modification at runtime and improves code safety.

Impact

This change is fully backward compatible and has no functional impact on behavior.
It only improves clarity and maintainability of the codebase.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions