refactor: modernize interface{} to any and improve eval benchmarks#654
Merged
zhouzhuojie merged 5 commits intomainfrom Feb 6, 2026
Merged
refactor: modernize interface{} to any and improve eval benchmarks#654zhouzhuojie merged 5 commits intomainfrom
zhouzhuojie merged 5 commits intomainfrom
Conversation
Replace all interface{} type declarations with the modern any keyword
for improved code consistency with Go 1.18+ generics.
Changes:
- pkg/entity/evaluator.go: EvalContext.EntityContext
- pkg/entity/db.go: AutoMigrateTables slice
- pkg/entity/fixture.go: Attachment maps
- pkg/entity/logger.go: variadic logging functions
- pkg/mapper/entity_restapi/r2e/r2e.go: MapAttachment function
- pkg/config/middleware.go: recoveryLogger and JWT validation
- pkg/handler/error.go: Error type and functions
- pkg/handler/eval.go: entity context type assertion
- pkg/handler/subject.go: JWT parsing
- pkg/handler/eval_cache.go: cache functions
- pkg/handler/crud_test.go: test fixtures
- pkg/handler/eval_test.go: test fixtures
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
foxdalas
pushed a commit
to foxdalas/flagr
that referenced
this pull request
Feb 7, 2026
…penflagr#654) * refactor: modernize interface{} to any for Go 1.18+ compatibility Replace all interface{} type declarations with the modern any keyword for improved code consistency with Go 1.18+ generics. Changes: - pkg/entity/evaluator.go: EvalContext.EntityContext - pkg/entity/db.go: AutoMigrateTables slice - pkg/entity/fixture.go: Attachment maps - pkg/entity/logger.go: variadic logging functions - pkg/mapper/entity_restapi/r2e/r2e.go: MapAttachment function - pkg/config/middleware.go: recoveryLogger and JWT validation - pkg/handler/error.go: Error type and functions - pkg/handler/eval.go: entity context type assertion - pkg/handler/subject.go: JWT parsing - pkg/handler/eval_cache.go: cache functions - pkg/handler/crud_test.go: test fixtures - pkg/handler/eval_test.go: test fixtures Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> * Make batch benchmarks use realistic eval cache fixtures * Harden CI checks and clean up docs and benchmark fixtures * update * update --------- Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
interface{}withanyin config, entity, handler, mapper, and related tests.Commit Breakdown
197a3708-refactor: modernize interface{} to any for Go 1.18+ compatibilityinterface{}->anyupdates across middleware, entity models, handlers, mapper helpers, and tests.efce8334-Make batch benchmarks use realistic eval cache fixturesBenchmark Snapshot
From
go test ./pkg/handler -run '^$' -bench 'BenchmarkPostEvaluationBatch$|BenchmarkPostEvaluationBatchWithTags$':BenchmarkPostEvaluationBatch-3:430084 ns/opBenchmarkPostEvaluationBatchWithTags-3:229705 ns/opValidation
go test ./... -run '^$'go test ./pkg/handler -run '^$' -bench 'BenchmarkPostEvaluationBatch$|BenchmarkPostEvaluationBatchWithTags$'