diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-20 22:53:18 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-20 22:53:18 +0200 |
| commit | 53777ee18c94b0267a327e48f65e2977e08aaf70 (patch) | |
| tree | 0234c5a31e140a8310f5213a86351c373bdd9a6f | |
| parent | 76272c9de69e9053f13cf65236bddebaa2952c4b (diff) | |
internal/rpn/variables: Reorder types and functions per Go best practices
- Moved VariableInfo type to top of file, before Variables type
- NewVariables constructor now immediately follows type definitions
- This aligns with project Go best practices for file organization
| -rw-r--r-- | internal/rpn/variables.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/internal/rpn/variables.go b/internal/rpn/variables.go index 40f0844..69f5b18 100644 --- a/internal/rpn/variables.go +++ b/internal/rpn/variables.go @@ -68,6 +68,12 @@ func (s *Stack) Clear() { s.values = s.values[:0] } +// VariableInfo represents a single variable with its name and value. +type VariableInfo struct { + Name string + Value float64 +} + // Variables stores variable name-value pairs for RPN calculations. // It provides thread-safe access to variable storage. type Variables struct { @@ -149,12 +155,6 @@ func (v *Variables) ListVariables() []VariableInfo { return infos } -// VariableInfo represents a single variable with its name and value. -type VariableInfo struct { - Name string - Value float64 -} - // ClearVariables removes all variables from storage. // Usage: `clear` removes all variables. func (v *Variables) ClearVariables() { |
