-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
v3: Use Named Fields Instead of Positional and Align Structures to Reduce Memory Usage #3079
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThis change set includes a comprehensive reorganization of Go files, focusing on enhancing clarity and maintainability through the reordering of struct fields and improvements in configuration options. Key modifications involve reactivating certain linting checks, refining middleware settings, and updating test case definitions for better readability. The overall goal is to streamline the codebase and ensure consistent data handling while preserving existing functionalities. Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3079 +/- ##
==========================================
- Coverage 83.14% 83.12% -0.03%
==========================================
Files 115 115
Lines 8332 8332
==========================================
- Hits 6928 6926 -2
- Misses 1075 1076 +1
- Partials 329 330 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
Outside diff range, codebase verification and nitpick comments (24)
middleware/proxy/config.go (1)
28-29: Ensure consistent naming conventions.The
TlsConfigfield should be renamed toTLSConfigto follow Go naming conventions. This change is already noted in the comment.- TlsConfig *tls.Config //nolint:stylecheck,revive // TODO: Rename to "TLSConfig" in v3 + TLSConfig *tls.Config //nolint:stylecheck,revive // TODO: Rename to "TLSConfig" in v3middleware/cache/config.go (3)
39-44: The purpose and usage of theCacheHeaderfield are not clearly documented.
- The current comment mentions possible return values but does not explain the purpose and usage of the
CacheHeaderfield.Analysis chain
Clarify the purpose of the
CacheHeaderfield.The comment for the
CacheHeaderfield has been updated. Ensure that the purpose and usage of this field are clear and documented.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the purpose and usage of the `CacheHeader` field are clear and documented. # Test: Search for documentation related to the `CacheHeader` field. Expect: Clear documentation is present. rg --type markdown --type go -A 5 'CacheHeader string'Length of output: 415
64-68: Ensure theCacheControlfield is properly validated.The
CacheControlfield is being used in various parts of the codebase, but there is no explicit validation logic to enforce its requirements. Please add proper validation to ensure theCacheControlfield is used correctly.
- File:
middleware/cache/config.go- Lines: 64-68
Analysis chain
Ensure the
CacheControlfield is properly validated.The
CacheControlfield has been moved. Ensure that proper validation is in place to enforce this field's requirements.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the `CacheControl` field is properly validated. # Test: Search for validation logic related to the `CacheControl` field. Expect: Validation logic is present. rg --type go -A 5 'CacheControl bool'Length of output: 354
Script:
#!/bin/bash # Description: Search for validation logic related to the `CacheControl` field. # Test: Search for functions or methods that reference `CacheControl`. Expect: Validation logic is present. rg --type go 'CacheControl' -A 10Length of output: 26535
46-50: Ensure theMethodsfield is properly validated.The
Methodsfield is a new addition, and no validation logic was found to enforce its requirements. It is recommended to add proper validation to ensure that theMethodsfield contains valid HTTP methods.
- Location:
middleware/cache/config.golines 46-50- Function:
configDefaultinmiddleware/cache/config.goAnalysis chain
Ensure the
Methodsfield is properly validated.The
Methodsfield is a new addition. Ensure that proper validation is in place to enforce this field's requirements.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the `Methods` field is properly validated. # Test: Search for validation logic related to the `Methods` field. Expect: Validation logic is present. rg --type go -A 5 'Methods []string'Length of output: 125
Script:
#!/bin/bash # Description: Verify that the `Methods` field is properly validated. # Test: Search for validation logic related to the `Methods` field. Expect: Validation logic is present. rg --type go -A 10 'Methods \[\]string'Length of output: 1629
Script:
#!/bin/bash # Description: Search for functions in the `middleware/cache/config.go` file to identify any validation logic related to the `Methods` field. # List all functions in the `middleware/cache/config.go` file. ast-grep --lang go --pattern 'func $_($_) $_' middleware/cache/config.goLength of output: 1501
Script:
#!/bin/bash # Description: Search for any validation functions or methods related to the `Methods` field in the codebase. # Search for functions that might validate the `Methods` field. rg --type go 'func validateMethods' -A 10Length of output: 43
Script:
#!/bin/bash # Description: Search for any validation logic related to the `Methods` field in the codebase using common validation keywords. # Search for validation logic related to the `Methods` field. rg --type go 'validate|check' -A 10Length of output: 146055
listen.go (6)
43-46: Add documentation forGracefulContext.The
GracefulContextfield allows for graceful shutdown using a provided context. Ensure that this field is documented properly to guide users on its usage.
48-51: Add documentation forTLSConfigFunc.The
TLSConfigFuncfield allows customization of thetls.Config. Ensure that this field is documented properly to guide users on its usage.
53-56: Add documentation forListenerAddrFunc.The
ListenerAddrFuncfield allows customization of thenet.Listener. Ensure that this field is documented properly to guide users on its usage.
58-61: Add documentation forBeforeServeFunc.The
BeforeServeFuncfield allows customization before serving the app. Ensure that this field is documented properly to guide users on its usage.
63-67: Add documentation forOnShutdownError.The
OnShutdownErrorfield allows customization of error behavior during graceful shutdown. Ensure that this field is documented properly to guide users on its usage.
69-72: Add documentation forOnShutdownSuccess.The
OnShutdownSuccessfield allows customization of success behavior during graceful shutdown. Ensure that this field is documented properly to guide users on its usage.client/client.go (6)
37-38: Add documentation for theloggerfield.The
loggerfield is a new addition and should have a comment explaining its purpose.// logger is used for logging client operations. logger log.CommonLogger
52-53: Add documentation for thecookieJarfield.The
cookieJarfield is a new addition and should have a comment explaining its purpose.// cookieJar manages cookies for the client. cookieJar *CookieJar
54-55: Add documentation for theretryConfigfield.The
retryConfigfield is a new addition and should have a comment explaining its purpose.// retryConfig holds the retry configuration for the client. retryConfig *RetryConfig
61-62: Add documentation for theproxyURLfield.The
proxyURLfield is a new addition and should have a comment explaining its purpose.// proxyURL specifies the proxy server URL. proxyURL string
614-615: Add documentation for theFormDatafield.The
FormDatafield is a new addition and should have a comment explaining its purpose.// FormData holds form data for the request. FormData map[string]string
618-619: Add documentation for theFilefield.The
Filefield is a new addition and should have a comment explaining its purpose.// File holds the files to be uploaded with the request. File []*Fileapp.go (7)
145-150: Add documentation for theCompressedFileSuffixesfield.The
CompressedFileSuffixesfield is a new addition and should have a comment explaining its purpose.// CompressedFileSuffixes adds suffix to the original file name and // tries saving the resulting compressed file under the new file name. CompressedFileSuffixes map[string]string `json:"compressed_file_suffixes"`
151-155: Add documentation for theErrorHandlerfield.The
ErrorHandlerfield is a new addition and should have a comment explaining its purpose.// ErrorHandler is executed when an error is returned from fiber.Handler. ErrorHandler ErrorHandler `json:"-"`
161-162: Add documentation for theJSONEncoderfield.The
JSONEncoderfield is a new addition and should have a comment explaining its purpose.// JSONEncoder allows for flexibility in using another JSON library for encoding. JSONEncoder utils.JSONMarshal `json:"-"`
168-169: Add documentation for theJSONDecoderfield.The
JSONDecoderfield is a new addition and should have a comment explaining its purpose.// JSONDecoder allows for flexibility in using another JSON library for decoding. JSONDecoder utils.JSONUnmarshal `json:"-"`
175-176: Add documentation for theXMLEncoderfield.The
XMLEncoderfield is a new addition and should have a comment explaining its purpose.// XMLEncoder allows for flexibility in using another XML library for encoding. XMLEncoder utils.XMLMarshal `json:"-"`
210-211: Add documentation for theTrustedProxiesfield.The
TrustedProxiesfield is a new addition and should have a comment explaining its purpose.// TrustedProxies defines a list of trusted proxy IP addresses. TrustedProxies []string `json:"trusted_proxies"`
182-183: Add documentation for theColorSchemefield.The
ColorSchemefield is a new addition and should have a comment explaining its purpose.// ColorScheme defines custom color schemes for the application. ColorScheme Colors `json:"color_scheme"`ctx.go (1)
178-183: Ensure all initializations and usages ofCookieare updated to reflect the new fields.The addition of
ExpiresandSameSitefields in theCookiestruct is approved. However, the following instances need to be updated to handle the new fields:
- redirect.go: Lines where
Cookieis initialized (e.g.,r.c.Cookie(&Cookie{...})) should include the new fields.- ctx.go: The
Cookiemethod should ensure the new fields are set correctly.- ctx_test.go: Test cases should include checks for the new fields.
- middleware/session/session.go: Ensure the new fields are handled when setting cookies.
- middleware/csrf/csrf.go: Handle the new fields when setting CSRF cookies.
Please update the code to reflect these changes and ensure all instances of
Cookieinclude theExpiresandSameSitefields.Analysis chain
LGTM! But verify the struct usage in the codebase.
The addition of
ExpiresandSameSitefields in theCookiestruct is approved.However, ensure that all initializations and usages of
Cookieare updated to reflect the new fields.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all initializations and usages of `Cookie` match the new fields. # Test: Search for the struct usage. Expect: Occurrences with the new fields. rg --type go -A 5 $'Cookie'Length of output: 167796
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (56)
- .golangci.yml (1 hunks)
- addon/retry/exponential_backoff_test.go (1 hunks)
- app.go (8 hunks)
- bind_test.go (16 hunks)
- binder/mapping.go (1 hunks)
- client/client.go (3 hunks)
- client/client_test.go (3 hunks)
- client/cookiejar.go (1 hunks)
- client/core_test.go (1 hunks)
- client/request.go (2 hunks)
- client/request_test.go (6 hunks)
- client/response.go (1 hunks)
- ctx.go (5 hunks)
- ctx_test.go (14 hunks)
- group.go (1 hunks)
- helpers.go (2 hunks)
- helpers_test.go (2 hunks)
- internal/memory/memory.go (2 hunks)
- internal/schema/cache.go (1 hunks)
- internal/schema/decoder.go (1 hunks)
- internal/storage/memory/memory.go (2 hunks)
- listen.go (3 hunks)
- listen_test.go (1 hunks)
- log/default_test.go (3 hunks)
- middleware/adaptor/adaptor_test.go (2 hunks)
- middleware/basicauth/basicauth_test.go (1 hunks)
- middleware/basicauth/config.go (2 hunks)
- middleware/cache/config.go (3 hunks)
- middleware/cache/manager.go (1 hunks)
- middleware/compress/compress_test.go (4 hunks)
- middleware/cors/config.go (2 hunks)
- middleware/cors/cors_test.go (3 hunks)
- middleware/cors/utils_test.go (3 hunks)
- middleware/csrf/config.go (3 hunks)
- middleware/csrf/csrf.go (1 hunks)
- middleware/csrf/csrf_test.go (1 hunks)
- middleware/csrf/helpers_test.go (1 hunks)
- middleware/csrf/session_manager.go (2 hunks)
- middleware/csrf/token.go (1 hunks)
- middleware/encryptcookie/config.go (2 hunks)
- middleware/encryptcookie/encryptcookie_test.go (4 hunks)
- middleware/envvar/envvar_test.go (1 hunks)
- middleware/etag/config.go (2 hunks)
- middleware/favicon/favicon.go (2 hunks)
- middleware/helmet/config.go (2 hunks)
- middleware/idempotency/config.go (1 hunks)
- middleware/idempotency/locker.go (1 hunks)
- middleware/idempotency/response.go (1 hunks)
- middleware/keyauth/config.go (2 hunks)
- middleware/keyauth/keyauth_test.go (2 hunks)
- middleware/limiter/config.go (2 hunks)
- middleware/logger/config.go (3 hunks)
- middleware/logger/data.go (1 hunks)
- middleware/logger/logger_test.go (1 hunks)
- middleware/proxy/config.go (3 hunks)
- middleware/proxy/proxy.go (1 hunks)
Files not processed due to max files limit (16)
- middleware/recover/config.go
- middleware/redirect/config.go
- middleware/requestid/config.go
- middleware/session/config.go
- middleware/session/data.go
- middleware/session/session.go
- middleware/session/store.go
- middleware/static/config.go
- middleware/static/static_test.go
- mount.go
- path.go
- path_testcases_test.go
- prefork.go
- redirect.go
- redirect_test.go
- router.go
Files skipped from review due to trivial changes (38)
- addon/retry/exponential_backoff_test.go
- binder/mapping.go
- client/cookiejar.go
- client/core_test.go
- client/request.go
- client/request_test.go
- client/response.go
- group.go
- helpers.go
- helpers_test.go
- internal/memory/memory.go
- internal/schema/cache.go
- internal/schema/decoder.go
- internal/storage/memory/memory.go
- listen_test.go
- log/default_test.go
- middleware/adaptor/adaptor_test.go
- middleware/basicauth/basicauth_test.go
- middleware/basicauth/config.go
- middleware/cache/manager.go
- middleware/compress/compress_test.go
- middleware/cors/config.go
- middleware/cors/cors_test.go
- middleware/cors/utils_test.go
- middleware/csrf/csrf.go
- middleware/csrf/csrf_test.go
- middleware/csrf/helpers_test.go
- middleware/csrf/session_manager.go
- middleware/csrf/token.go
- middleware/encryptcookie/encryptcookie_test.go
- middleware/envvar/envvar_test.go
- middleware/favicon/favicon.go
- middleware/idempotency/locker.go
- middleware/idempotency/response.go
- middleware/keyauth/keyauth_test.go
- middleware/limiter/config.go
- middleware/logger/data.go
- middleware/logger/logger_test.go
Additional comments not posted (80)
middleware/etag/config.go (1)
9-12: LGTM! Verify the usage of the newNextfield.The addition of the
Nextfield enhances the configurability of the middleware by allowing custom logic for skipping the middleware. The default value ofnilensures backward compatibility.However, ensure that the new field is correctly utilized in the codebase.
Verification successful
The
Nextfield is correctly utilized in the codebase.The
Nextfield is used in various middleware configurations and implementations, confirming its proper integration and utilization.
middleware/static/static.gomiddleware/rewrite/rewrite.gomiddleware/recover/recover.gomiddleware/logger/logger.gomiddleware/etag/etag.gomiddleware/proxy/proxy.gomiddleware/limiter/limiter_fixed.gomiddleware/healthcheck/healthcheck.gomiddleware/idempotency/idempotency.gomiddleware/csrf/csrf.gomiddleware/compress/compress.gomiddleware/cors/cors.gomiddleware/basicauth/basicauth.gomiddleware/earlydata/earlydata.gomiddleware/encryptcookie/encryptcookie.gomiddleware/cache/cache.goScripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of the `Next` field in the codebase. # Test: Search for the usage of the `Next` field. Expect: Correct utilization. rg --type go -A 5 $'Next func(c fiber.Ctx) bool'Length of output: 49
Script:
#!/bin/bash # Description: Verify the usage of the `Next` field in the codebase. # Test: Search for the assignment and usage of the `Next` field in the codebase. rg --type go 'Next'Length of output: 26458
middleware/encryptcookie/config.go (3)
14-17: LGTM! Verify the usage of theEncryptorfield.The reorganization and updated comments for the
Encryptorfield improve the clarity of the configuration options. The default value remains unchanged, ensuring backward compatibility.However, ensure that the
Encryptorfield is correctly utilized in the codebase.Verification successful
The
Encryptorfield is correctly utilized in the codebase.The field is referenced in the configuration, main implementation, and test files, ensuring its proper functionality and coverage.
middleware/encryptcookie/config.go: Initialization and default setting.middleware/encryptcookie/encryptcookie.go: Usage in the encryption process.middleware/encryptcookie/encryptcookie_test.go: Custom encryptor test cases.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of the `Encryptor` field in the codebase. # Test: Search for the usage of the `Encryptor` field. Expect: Correct utilization. rg --type go -A 5 $'Encryptor func(decryptedString, key string) (string, error)'Length of output: 81
Script:
#!/bin/bash # Description: Verify the usage of the `Encryptor` field in the codebase. # Test: Search for references to the `Encryptor` field in the codebase. rg --type go 'Encryptor'Length of output: 1308
19-22: LGTM! Verify the usage of theDecryptorfield.The reorganization and updated comments for the
Decryptorfield improve the clarity of the configuration options. The default value remains unchanged, ensuring backward compatibility.However, ensure that the
Decryptorfield is correctly utilized in the codebase.Verification successful
The
Decryptorfield is correctly utilized in the codebase.The
Decryptorfield is defined, assigned a default value if not provided, and called appropriately within the codebase. The reorganization and updated comments for theDecryptorfield improve the clarity of the configuration options.
middleware/encryptcookie/config.go: Definition and assignment.middleware/encryptcookie/encryptcookie.go: Function call.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of the `Decryptor` field in the codebase. # Test: Search for the usage of the `Decryptor` field. Expect: Correct utilization. rg --type go -A 5 $'Decryptor func(encryptedString, key string) (string, error)'Length of output: 81
Script:
#!/bin/bash # Description: Verify the usage of the `Decryptor` field in the codebase. # Search for the usage of the `Decryptor` field in the codebase. rg --type go 'Decryptor' # Search for instances where the `Decryptor` field is assigned a value. rg --type go 'Decryptor =' # Search for instances where the `Decryptor` field is called. rg --type go 'Decryptor('Length of output: 1029
Script:
#!/bin/bash # Description: Verify the usage of the `Decryptor` field in the codebase. # Search for instances where the `Decryptor` field is called, fixing the regex error. rg --type go 'Decryptor\('Length of output: 135
31-34: LGTM! Verify the usage of theExceptfield.The reorganization and updated comments for the
Exceptfield improve the clarity of the configuration options. The default value remains unchanged, ensuring backward compatibility.However, ensure that the
Exceptfield is correctly utilized in the codebase.Verification successful
The
Exceptfield is correctly utilized in the codebase.The field is used in conditional statements and test cases, ensuring its functionality is verified and maintained.
middleware/encryptcookie/encryptcookie.go: Conditional checks involvingcfg.Except.middleware/encryptcookie/encryptcookie_test.go: Initialization in test cases.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of the `Except` field in the codebase. # Test: Search for the usage of the `Except` field. Expect: Correct utilization. rg --type go -A 5 $'Except []string'Length of output: 122
Script:
#!/bin/bash # Description: Verify the usage of the `Except` field in the codebase. # Test: Search for the usage of the `Except` field. Expect: Correct utilization. rg --type go -A 5 'Except\s*\[\]string'Length of output: 355
Script:
#!/bin/bash # Description: Verify the usage of the `Except` field in the codebase. # Test: Search for the usage of the `Except` field. Expect: Correct utilization. rg --type go 'Except'Length of output: 1039
middleware/keyauth/config.go (2)
26-27: LGTM! Verify the usage of theCustomKeyLookupfield.The reorganization of the
CustomKeyLookupfield improves the clarity of the configuration options. The functionality remains unchanged, ensuring backward compatibility.However, ensure that the
CustomKeyLookupfield is correctly utilized in the codebase.Verification successful
Verified: The
CustomKeyLookupfield is correctly utilized in the codebase, including appropriate checks and tests.
middleware/keyauth/keyauth.go: Utilized in multiple logical conditions and function calls.middleware/keyauth/keyauth_test.go: Tested to ensure proper functionality.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of the `CustomKeyLookup` field in the codebase. # Test: Search for the usage of the `CustomKeyLookup` field. Expect: Correct utilization. rg --type go -A 5 $'CustomKeyLookup KeyLookupFunc'Length of output: 424
Script:
#!/bin/bash # Description: Search for the usage of the `CustomKeyLookup` field in the codebase. # Test: Search for the term `CustomKeyLookup` to find all instances of its usage. rg --type go 'CustomKeyLookup'Length of output: 710
28-29: LGTM! Verify the usage of theValidatorfield.The addition of the
Validatorfield enhances the flexibility of theConfigstruct by allowing custom key validation logic. The default value ofnilensures backward compatibility.However, ensure that the
Validatorfield is correctly utilized in the codebase.Verification successful
The
Validatorfield is correctly utilized in the codebase.The
Validatorfield is referenced in the implementation filemiddleware/keyauth/keyauth.goand is extensively tested inmiddleware/keyauth/keyauth_test.go. This ensures that the custom key validation logic is properly integrated and verified.
middleware/keyauth/keyauth.go:valid, err := cfg.Validator(c, key)middleware/keyauth/keyauth_test.go: Multiple instances ofValidatorfunction definitions and usage in tests.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of the `Validator` field in the codebase. # Test: Search for the usage of the `Validator` field. Expect: Correct utilization. rg --type go -A 5 $'Validator func(fiber.Ctx, string) (bool, error)'Length of output: 69
Script:
#!/bin/bash # Description: Verify the usage of the `Validator` field in the codebase. # Test: Search for any references to the `Validator` field. rg --type go 'Validator'Length of output: 1842
middleware/proxy/config.go (2)
31-34: Clarify the impact of setting theClientfield.The comment indicates that certain fields will not be used if the
Clientis set. Ensure this behavior is documented and tested.
36-42: EnsureServersfield is properly validated.The
Serversfield is marked as required. Ensure that proper validation is in place to enforce this requirement.Verification successful
The
Serversfield has basic validation in place.The validation logic includes:
- Ensuring the
Serversfield is not empty ifcfg.Clientis also nil.- Ensuring each server URL starts with "http".
- Parsing each server URL and handling errors.
This provides a basic level of validation for the
Serversfield.
middleware/proxy/config.go:if len(cfg.Servers) == 0 && cfg.Client == nil { panic("Servers cannot be empty") }
middleware/proxy/proxy.go:for _, server := range cfg.Servers { if !strings.HasPrefix(server, "http") { server = "http://" + server } u, err := url.Parse(server) if err != nil { panic(err) } }Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the `Servers` field is properly validated. # Test: Search for validation logic related to the `Servers` field. Expect: Validation logic is present. rg --type go -A 5 'Servers []string'Length of output: 125
Script:
#!/bin/bash # Description: Verify that the `Servers` field is properly validated. # Test: Search for validation logic related to the `Servers` field. Expect: Validation logic is present. rg --type go -A 5 'Servers \[\]string'Length of output: 350
Script:
#!/bin/bash # Description: Verify that the `Servers` field is properly validated. # Test: Search for validation functions or methods that might validate the `Servers` field. rg --type go -i 'validate|validation|Servers'Length of output: 8871
Script:
#!/bin/bash # Description: Verify that the `Servers` field is properly validated. # Test: Search for validation logic specifically around the `cfg.Servers` field. rg --type go -A 10 'cfg.Servers'Length of output: 783
middleware/cache/config.go (3)
52-55: Ensure theExpirationfield is properly validated.The
Expirationfield has been moved. Ensure that proper validation is in place to enforce this field's requirements.Verification successful
The
Expirationfield is properly validated.The
Expirationfield inmiddleware/cache/config.gois validated to ensure it is not zero or negative, and a default value is assigned if it is zero. This ensures the field is properly validated.
- In
middleware/cache/config.go, lines 52-55:
- The field is assigned a default value of
1 * time.Minute.- There is a conditional check
if int(cfg.Expiration.Seconds()) == 0which sets it to a default value if it is zero.- There is also a check
if int(cfg.Expiration.Seconds()) < 0which returns an error if the expiration is negative.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the `Expiration` field is properly validated. # Test: Search for validation logic related to the `Expiration` field. Expect: Validation logic is present. rg --type go -A 5 'Expiration time.Duration'Length of output: 1331
Script:
#!/bin/bash # Description: Verify that the `Expiration` field in middleware/cache/config.go is properly validated. # Search for functions or methods that reference the `Expiration` field in middleware/cache/config.go and include context lines to identify validation logic. rg --type go -A 10 'Expiration' middleware/cache/config.goLength of output: 1822
Script:
#!/bin/bash # Description: Verify that the `Expiration` field is properly validated across the codebase. # Search for validation logic related to the `Expiration` field across the entire codebase. rg --type go 'Expiration' -A 10Length of output: 42817
12-15: Ensure theStoragefield is properly initialized.The
Storagefield is moved and redefined. Ensure that it is properly initialized and used throughout the codebase.
69-72: Ensure theStoreResponseHeadersfield is properly validated.The
StoreResponseHeadersfield has been moved. Ensure that proper validation is in place to enforce this field's requirements.middleware/idempotency/config.go (4)
21-24: Ensure theStoragefield is properly initialized.The
Storagefield is a new addition. Ensure that it is properly initialized and used throughout the codebase.Verification successful
The
Storagefield is properly initialized and used.The
Storagefield inmiddleware/idempotency/config.gois assigned a default value if it isniland is used in various operations such asGetandSet.
- Initialization:
middleware/idempotency/config.go- Usage:
middleware/idempotency/idempotency.goScripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the `Storage` field is properly initialized and used. # Test: Search for initialization and usage of the `Storage` field. Expect: Proper initialization and usage. rg --type go -A 5 'Storage fiber.Storage'Length of output: 1762
Script:
#!/bin/bash # Description: Verify the initialization and usage of the `Storage` field. # Search for assignments to the `Storage` field. rg --type go 'Storage =' # Search for usages of the `Storage` field. rg --type go '\.Storage'Length of output: 2699
30-33: Ensure theKeyHeaderValidatefield is properly validated.The
KeyHeaderValidatefield has been moved. Ensure that proper validation is in place to enforce this field's requirements.Verification successful
Proper validation of
KeyHeaderValidatefield confirmed.The
KeyHeaderValidatefield is defined and used appropriately in the codebase. Specifically:
- Definition and Default Assignment: The field is defined in
middleware/idempotency/config.gowith a default function that ensures the header is 36 characters long.- Usage: The field is used in
middleware/idempotency/idempotency.goto validate the idempotency key.No further action is required as the validation logic is in place and correctly invoked.
middleware/idempotency/config.gomiddleware/idempotency/idempotency.goScripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the `KeyHeaderValidate` field is properly validated. # Test: Search for validation logic related to the `KeyHeaderValidate` field. Expect: Validation logic is present. rg --type go -A 5 'KeyHeaderValidate func(string) error'Length of output: 58
Script:
#!/bin/bash # Description: Verify that the `KeyHeaderValidate` field is properly validated. # Search for the definition of the `KeyHeaderValidate` field to understand its context. rg --type go 'KeyHeaderValidate func(string) error' # Search for the usage of the `KeyHeaderValidate` field in the codebase to find where it might be validated. rg --type go 'KeyHeaderValidate' # Search for validation functions or methods that might be related to the `KeyHeaderValidate` field. rg --type go 'validate' -A 10Length of output: 12995
16-20: Ensure theLockfield is properly initialized.The
Lockfield is a new addition. Ensure that it is properly initialized and used throughout the codebase.Verification successful
The
Lockfield is properly initialized and used.The
Lockfield in theConfigstruct is initialized withNewMemoryLock()in theconfigDefaultfunction if not provided. It is also correctly used in theidempotencymiddleware for locking and unlocking operations.
- Initialization:
middleware/idempotency/config.go- Usage:
middleware/idempotency/idempotency.goScripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the `Lock` field is properly initialized and used. # Test: Search for initialization and usage of the `Lock` field. Expect: Proper initialization and usage. rg --type go -A 5 'Lock Locker'Length of output: 392
Script:
#!/bin/bash # Description: Verify that the `Lock` field is properly initialized and used. # Test: Search for instances where the `Config` struct is instantiated and check for initialization of the `Lock` field. rg --type go 'Config{' -A 10 # Test: Search for usage of the `Lock` field within the codebase. rg --type go '\.Lock' -A 5 -B 5Length of output: 32228
45-48: Ensure theLifetimefield is properly validated.The
Lifetimefield has been moved. Ensure that proper validation is in place to enforce this field's requirements.middleware/helmet/config.go (1)
66-80: Ensure consistency of comments and default values.The fields
HSTSMaxAge,HSTSExcludeSubdomains,CSPReportOnly, andHSTSPreloadEnabledhave been moved. Verify that the comments and default values remain consistent with the rest of the struct.middleware/logger/config.go (4)
13-16: Verify the default value forOutput.The
Outputfield specifies the destination for log output with a default value ofos.Stdout. Ensure that this default value is appropriate and consistent with the intended functionality.
34-37: Verify the default value forBeforeHandlerFunc.The
BeforeHandlerFuncfield allows customization before the handler is executed with a default value ofbeforeHandlerFunc. Ensure that this default value is appropriate and consistent with the intended functionality.
39-44: Verify the default value forLoggerFunc.The
LoggerFuncfield enables the use of custom logging implementations with a default value ofdefaultLogger. Ensure that this default value is appropriate and consistent with the intended functionality.
46-46: Ensure consistency of comments and default values.The
timeZoneLocationfield has been repositioned. Verify that the comments and default values remain consistent with the rest of the struct.middleware/csrf/config.go (12)
16-21: Verify the default value forStorage.The
Storagefield is used to store the state of the middleware with a default value ofmemory.New(). Ensure that this default value is appropriate and consistent with the intended functionality.
27-32: Verify the default value forSession.The
Sessionfield is used to store the state of the middleware with a default value ofnil. Ensure that this default value is appropriate and consistent with the intended functionality.
33-37: Verify the default value forKeyGenerator.The
KeyGeneratorfield creates a new CSRF token with a default value ofutils.UUID. Ensure that this default value is appropriate and consistent with the intended functionality.
38-42: Verify the default value forErrorHandler.The
ErrorHandlerfield is executed when an error is returned fromfiber.Handlerwith a default value ofDefaultErrorHandler. Ensure that this default value is appropriate and consistent with the intended functionality.
43-49: Verify the default value forExtractor.The
Extractorfield returns the CSRF token with a default value that is created based onKeyLookup. Ensure that this default value is appropriate and consistent with the intended functionality.
104-106: Verify the default value forCookieSecure.The
CookieSecurefield indicates if the CSRF cookie is secure with a default value offalse. Ensure that this default value is appropriate and consistent with the intended functionality.
108-110: Verify the default value forCookieHTTPOnly.The
CookieHTTPOnlyfield indicates if the CSRF cookie is HTTP only with a default value offalse. Ensure that this default value is appropriate and consistent with the intended functionality.
112-114: Verify the default value forCookieSessionOnly.The
CookieSessionOnlyfield decides whether the cookie should last for only the browser session with a default value offalse. Ensure that this default value is appropriate and consistent with the intended functionality.
116-120: Verify the default value forSingleUseToken.The
SingleUseTokenfield indicates if the CSRF token should be destroyed and a new one generated on each use with a default value offalse. Ensure that this default value is appropriate and consistent with the intended functionality.
99-102: Verify the accuracy of theExpirationfield's documentation.The documentation for the
Expirationfield specifies a default value of1 * time.Hour. Ensure that this default value is accurate and consistent with the actual default value used in the code.
Line range hint
16-120:
Ensure consistency of comments and default values.The fields within the
Configstruct have been reorganized. Verify that the comments and default values remain consistent with the rest of the struct.
Line range hint
16-120:
Verify the consistency of default values inConfigDefault.New fields have been added to the
ConfigDefaultvariable. Ensure that the default values for these fields are appropriate and consistent with the intended functionality.middleware/proxy/proxy.go (1)
217-220: Verify the impact of field reordering on memory alignment and thread safety.The
sync.Mutexfield has been moved after thepool []stringfield. Ensure that this change does not negatively impact memory alignment or thread safety.Verification successful
Field reordering does not negatively impact memory alignment or thread safety.
The
sync.Mutexfield has been moved after thepool []stringfield. The usage of theroundrobinstruct, including thegetmethod, ensures thread safety by locking and unlocking the mutex appropriately. There is no indication of any negative impact on memory alignment or thread safety due to this change.
- The
roundrobinstruct and its methods handle thread safety correctly.- The initialization of the struct does not show any issues related to memory alignment.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the impact of field reordering on memory alignment and thread safety. # Test: Search for the usage of the `roundrobin` struct. Expect: No negative impact on memory alignment or thread safety. rg --type go -A 5 $'roundrobin'Length of output: 805
.golangci.yml (1)
Line range hint
108-108:
LGTM! Enablingfieldalignmentcheck improves memory efficiency.The
fieldalignmentcheck has been enabled, which will help ensure that struct fields are aligned properly, improving memory efficiency.app.go (1)
84-85: Verify the reordering of fields in theErrorstruct.Ensure that the reordering of fields in the
Errorstruct does not impact any JSON serialization or deserialization logic.client/client_test.go (3)
839-840: Verify the addition of theCookieIntfield.Ensure that the
CookieIntfield is correctly utilized in the test cases forTest_Client_Cookie.
1093-1095: Verify the addition of theTInt,TFloat, andTBoolfields.Ensure that the
TInt,TFloat, andTBoolfields are correctly utilized in the test cases forTest_Client_QueryParam.
1199-1200: Verify the addition of theCookieIntfield.Ensure that the
CookieIntfield is correctly utilized in the test cases forTest_Client_PathParam.bind_test.go (7)
31-31: Verify the addition of theIDfield.Ensure that the
IDfield aligns with the expected input data for the tests.
62-63: Verify the addition of theIDandBoolfields.Ensure that the
IDandBoolfields align with the expected input data for the tests.
241-241: Verify the addition of theValuefield.Ensure that the
Valuefield aligns with the expected input data for the tests.
297-297: Verify the addition of theIDfield.Ensure that the
IDfield aligns with the expected input data for the tests.
327-328: Verify the addition of theIDandBoolfields.Ensure that the
IDandBoolfields align with the expected input data for the tests.
1257-1257: Verify the addition of theIDfield.Ensure that the
IDfield aligns with the expected input data for the tests.
1287-1288: Verify the addition of theIDandBoolfields.Ensure that the
IDandBoolfields align with the expected input data for the tests.ctx.go (3)
200-200: LGTM! But verify the struct usage in the codebase.The reordering of the
MediaTypefield in theResFmtstruct is approved.However, ensure that all initializations and usages of
ResFmtare updated to reflect the new field order.Verification successful
Verified: Struct usage is consistent with the new field order.
The reordering of the
MediaTypefield in theResFmtstruct has been correctly applied across all usages in the codebase.
ctx.goctx_test.goctx_interface_gen.goScripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all initializations and usages of `ResFmt` match the new field order. # Test: Search for the struct usage. Expect: Only occurrences of the new field order. rg --type go -A 5 $'ResFmt'Length of output: 3172
53-70: LGTM! But verify the struct usage in the codebase.The reordering of fields in the
DefaultCtxstruct is approved.However, ensure that all initializations and usages of
DefaultCtxare updated to reflect the new field order.Verification successful
Verification Complete: No Issues Found
The reordering of fields in the
DefaultCtxstruct has been verified. All initializations and usages ofDefaultCtxacross the codebase align with the new field order.
redirect_test.gorouter.gohelpers.goctx_test.gobind_test.gorouter_test.goctx_interface.goapp_test.goScripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all initializations and usages of `DefaultCtx` match the new field order. # Test: Search for the struct usage. Expect: Only occurrences of the new field order. rg --type go -A 10 $'DefaultCtx'Length of output: 63368
116-116: LGTM! But verify the struct usage in the codebase.The reordering of the
configfield in thesendFileStorestruct is approved.However, ensure that all initializations and usages of
sendFileStoreare updated to reflect the new field order.Verification successful
Verified: The reordering of the
configfield in thesendFileStorestruct does not introduce any issues.The struct is correctly initialized and used with field names, so the field order is irrelevant.
ctx.godefines thesendFileStorestruct with theconfigfield.ctx.goinitializessendFileStorewith theconfigfield by name.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all initializations and usages of `sendFileStore` match the new field order. # Test: Search for the struct usage. Expect: Only occurrences of the new field order. rg --type go -A 5 $'sendFileStore'Length of output: 1022
ctx_test.go (32)
969-969: Use named fields for struct initialization.The
ResFmtstruct initialization should use named fields for clarity and maintainability.
991-991: Use named fields for struct initialization.The
ResFmtstruct initialization should use named fields for clarity and maintainability.
995-995: Use named fields for struct initialization.The
ResFmtstruct initialization should use named fields for clarity and maintainability.
1025-1025: Use named fields for struct initialization.The
ResFmtstruct initialization should use named fields for clarity and maintainability.
1026-1026: Use named fields for struct initialization.The
ResFmtstruct initialization should use named fields for clarity and maintainability.
1027-1027: Use named fields for struct initialization.The
ResFmtstruct initialization should use named fields for clarity and maintainability.
1028-1028: Use named fields for struct initialization.The
ResFmtstruct initialization should use named fields for clarity and maintainability.
1036-1036: Use named fields for struct initialization.The
ResFmtstruct initialization should use named fields for clarity and maintainability.
1037-1037: Use named fields for struct initialization.The
ResFmtstruct initialization should use named fields for clarity and maintainability.
1038-1038: Use named fields for struct initialization.The
ResFmtstruct initialization should use named fields for clarity and maintainability.
1039-1039: Use named fields for struct initialization.The
ResFmtstruct initialization should use named fields for clarity and maintainability.
1050-1050: Use named fields for struct initialization.The
ResFmtstruct initialization should use named fields for clarity and maintainability.
1051-1051: Use named fields for struct initialization.The
ResFmtstruct initialization should use named fields for clarity and maintainability.
1062-1062: Use named fields for struct initialization.The
ResFmtstruct initialization should use named fields for clarity and maintainability.
1063-1063: Use named fields for struct initialization.The
ResFmtstruct initialization should use named fields for clarity and maintainability.
1064-1064: Use named fields for struct initialization.The
ResFmtstruct initialization should use named fields for clarity and maintainability.
2144-2144: Use named fields for struct initialization.The
Userstruct initialization should use named fields for clarity and maintainability.
2148-2148: Use named fields for struct initialization.The
Userstruct initialization should use named fields for clarity and maintainability.
1373-1373: Use named fields for struct initialization.The
TestStructstruct initialization should use named fields for clarity and maintainability.
1374-1374: Use named fields for struct initialization.The
TestStructstruct initialization should use named fields for clarity and maintainability.
1377-1377: Use named fields for struct initialization.The
TestStructstruct initialization should use named fields for clarity and maintainability.
2720-2720: Use named fields for struct initialization.The
RangeSetstruct initialization should use named fields for clarity and maintainability.
2721-2721: Use named fields for struct initialization.The
RangeSetstruct initialization should use named fields for clarity and maintainability.
2722-2722: Use named fields for struct initialization.The
RangeSetstruct initialization should use named fields for clarity and maintainability.
2723-2723: Use named fields for struct initialization.The
RangeSetstruct initialization should use named fields for clarity and maintainability.
2700-2700: Use named fields for struct initialization.The
RangeSetstruct initialization should use named fields for clarity and maintainability.
2701-2701: Use named fields for struct initialization.The
RangeSetstruct initialization should use named fields for clarity and maintainability.
2702-2702: Use named fields for struct initialization.The
RangeSetstruct initialization should use named fields for clarity and maintainability.
2703-2703: Use named fields for struct initialization.The
RangeSetstruct initialization should use named fields for clarity and maintainability.
2704-2704: Use named fields for struct initialization.The
RangeSetstruct initialization should use named fields for clarity and maintainability.
2705-2705: Use named fields for struct initialization.The
RangeSetstruct initialization should use named fields for clarity and maintainability.
2706-2706: Use named fields for struct initialization.The
RangeSetstruct initialization should use named fields for clarity and maintainability.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- Makefile (1 hunks)
- app.go (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- app.go
Additional comments not posted (2)
Makefile (2)
55-56: Ensure.PHONYdeclaration is correct.The
.PHONYdeclaration forbetteralignis correctly added.
57-58: Review thebetteraligncommand syntax.The command syntax for running the
betteraligntool is correct. It uses the latest version of the tool and applies optimizations to test and generated files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- ctx_test.go (14 hunks)
Additional comments not posted (30)
ctx_test.go (30)
969-969: LGTM! The change to named fields improves readability.The use of named fields instead of positional parameters in the
ResFmtstruct enhances code clarity and maintainability.
991-991: LGTM! The change to named fields improves readability.The use of named fields instead of positional parameters in the
ResFmtstruct enhances code clarity and maintainability.
995-995: LGTM! The change to named fields improves readability.The use of named fields instead of positional parameters in the
ResFmtstruct enhances code clarity and maintainability.
1025-1028: LGTM! The change to named fields improves readability.The use of named fields instead of positional parameters in the
ResFmtstruct enhances code clarity and maintainability.
1036-1039: LGTM! The change to named fields improves readability.The use of named fields instead of positional parameters in the
ResFmtstruct enhances code clarity and maintainability.
1050-1051: LGTM! The change to named fields improves readability.The use of named fields instead of positional parameters in the
ResFmtstruct enhances code clarity and maintainability.
1062-1064: LGTM! The change to named fields improves readability.The use of named fields instead of positional parameters in the
ResFmtstruct enhances code clarity and maintainability.
1373-1374: LGTM! The change to named fields improves readability.The use of named fields instead of positional parameters in the
TestStructstruct enhances code clarity and maintainability.
1377-1377: LGTM! The change to named fields improves readability.The use of named fields instead of positional parameters in the
TestStructstruct enhances code clarity and maintainability.
2144-2144: LGTM! The change to named fields improves readability.The use of named fields instead of positional parameters in the
Userstruct enhances code clarity and maintainability.
2148-2148: LGTM! The change to named fields improves readability.The use of named fields instead of positional parameters in the
Userstruct enhances code clarity and maintainability.
2700-2700: LGTM! The change to named fields improves readability.The use of named fields instead of positional parameters in the
RangeSetstruct enhances code clarity and maintainability.
2701-2701: LGTM! The change to named fields improves readability.The use of named fields instead of positional parameters in the
RangeSetstruct enhances code clarity and maintainability.
2702-2702: LGTM! The change to named fields improves readability.The use of named fields instead of positional parameters in the
RangeSetstruct enhances code clarity and maintainability.
2703-2703: LGTM! The change to named fields improves readability.The use of named fields instead of positional parameters in the
RangeSetstruct enhances code clarity and maintainability.
2704-2704: LGTM! The change to named fields improves readability.The use of named fields instead of positional parameters in the
RangeSetstruct enhances code clarity and maintainability.
2705-2705: LGTM! The change to named fields improves readability.The use of named fields instead of positional parameters in the
RangeSetstruct enhances code clarity and maintainability.
2706-2706: LGTM! The change to named fields improves readability.The use of named fields instead of positional parameters in the
RangeSetstruct enhances code clarity and maintainability.
2720-2720: LGTM! The change to named fields improves readability.The use of named fields instead of positional parameters in the
RangeSetstruct enhances code clarity and maintainability.
2721-2721: LGTM! The change to named fields improves readability.The use of named fields instead of positional parameters in the
RangeSetstruct enhances code clarity and maintainability.
2722-2722: LGTM! The change to named fields improves readability.The use of named fields instead of positional parameters in the
RangeSetstruct enhances code clarity and maintainability.
2723-2723: LGTM! The change to named fields improves readability.The use of named fields instead of positional parameters in the
RangeSetstruct enhances code clarity and maintainability.
2144-2144: LGTM! The change to named fields improves readability.The use of named fields instead of positional parameters in the
Userstruct enhances code clarity and maintainability.
2148-2148: LGTM! The change to named fields improves readability.The use of named fields instead of positional parameters in the
Userstruct enhances code clarity and maintainability.
2144-2144: LGTM! The change to named fields improves readability.The use of named fields instead of positional parameters in the
Userstruct enhances code clarity and maintainability.
2148-2148: LGTM! The change to named fields improves readability.The use of named fields instead of positional parameters in the
Userstruct enhances code clarity and maintainability.
2144-2144: LGTM! The change to named fields improves readability.The use of named fields instead of positional parameters in the
Userstruct enhances code clarity and maintainability.
2148-2148: LGTM! The change to named fields improves readability.The use of named fields instead of positional parameters in the
Userstruct enhances code clarity and maintainability.
2144-2144: LGTM! The change to named fields improves readability.The use of named fields instead of positional parameters in the
Userstruct enhances code clarity and maintainability.
2148-2148: LGTM! The change to named fields improves readability.The use of named fields instead of positional parameters in the
Userstruct enhances code clarity and maintainability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- .github/workflows/benchmark.yml (1 hunks)
Files skipped from review due to trivial changes (1)
- .github/workflows/benchmark.yml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- .github/workflows/benchmark.yml (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- .github/workflows/benchmark.yml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- .github/workflows/benchmark.yml (1 hunks)
Additional comments not posted (1)
.github/workflows/benchmark.yml (1)
17-18: LGTM! The new permission is correctly added.The permission
pull-requests: writeallows the workflow to post comments on pull requests, enhancing interaction capabilities.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.
| Benchmark suite | Current: 0d34345 | Previous: ef07360 | Ratio |
|---|---|---|---|
Benchmark_Compress/Zstd - B/op |
1 B/op |
0 B/op |
+∞ |
Benchmark_Compress_Levels/Brotli_LevelBestCompression - B/op |
7 B/op |
0 B/op |
+∞ |
This comment was automatically generated by workflow using github-action-benchmark.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
…duce Memory Usage (#3079) * Use composites for internal structures. Fix alignment of structures across Fiber * Update struct alignment in test files * Enable alignment check with govet * Fix ctx autoformat unit-test * Revert app Config struct. Add betteralign to Makefile * Disable comment on alert since it wont work for forks * Update benchmark.yml * Update benchmark.yml * Remove warning from using positional fields * Update router.go
Description
betteralignto fix the order of fields for all structures used across Fiber.govet.The changes introduced by
betteralignresults in the following:Changes introduced
Type of change