diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-25 16:52:44 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-25 16:52:44 +0200 |
| commit | dcbfc88db0ee218f50dff019fda5931365a86edf (patch) | |
| tree | a6270f937866000f269d209aae6a6ca70263ce23 | |
| parent | ccffcdcf5c93529726162a2c33facb14b12cd9d8 (diff) | |
ci: Update Magefile to include shortcuts for build, test, lint, and release
- Added Lint target: runs golangci-lint for code quality checks
- Added Release target: builds and packages releases (requires goreleaser)
Also fixed errcheck linting issue:
- Check error return from o.vars.SetVariable in AssignVariable
All mage targets work: build, run, test, testRPN, rpn, install, lint, release, repl, uninstall
| -rw-r--r-- | Magefile.go | 13 | ||||
| -rwxr-xr-x | gt | bin | 3687024 -> 3687024 bytes | |||
| -rw-r--r-- | internal/rpn/operations.go | 3 |
3 files changed, 14 insertions, 2 deletions
diff --git a/Magefile.go b/Magefile.go index 05ec508..29d94f8 100644 --- a/Magefile.go +++ b/Magefile.go @@ -53,6 +53,19 @@ func Install() error { return sh.RunV("go", "install", "./cmd/gt") } +// Lint runs golangci-lint for code quality checks. +func Lint() error { + fmt.Println("Running golangci-lint...") + return sh.RunV("golangci-lint", "run", "./...") +} + +// Release builds and packages the release for all platforms. +func Release() error { + fmt.Println("Creating release...") + fmt.Println("Note: Requires goreleaser to be installed and configured.") + return sh.RunV("goreleaser", "release", "--clean") +} + // Repl starts the REPL mode. func Repl() error { return sh.RunV("go", "run", "./cmd/gt", "--repl") Binary files differdiff --git a/internal/rpn/operations.go b/internal/rpn/operations.go index 3bd0fc1..d9965ed 100644 --- a/internal/rpn/operations.go +++ b/internal/rpn/operations.go @@ -711,8 +711,7 @@ func (o *Operations) AssignVariable(stack *Stack, name string) error { } // Convert Value to float64 for variable storage - o.vars.SetVariable(name, toNumber(val)) - return nil + return o.vars.SetVariable(name, toNumber(val)) } // UseVariable pushes a variable's value onto the stack. |
