-
Notifications
You must be signed in to change notification settings - Fork 0
Fix Register, Add Linter, Add More Concurrency Tests #6
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
c470c76
adding retry for contested locks and an operation timeout
dcbickfo 1c97bb4
remove operation timeout
dcbickfo 80088b7
use context to ensure cancellation
dcbickfo 4380db7
merged in main
dcbickfo cfde17d
Update cacheaside.go
dcbickfo 3741e78
fixed raw deletion with compare and delete
dcbickfo f834a2d
Merge remote-tracking branch 'refs/remotes/origin/fix-wait' into fix-…
dcbickfo 808b9fe
merge in main
dcbickfo 4e13ff7
added fixes to register, added linter and updated example
dcbickfo 0757111
Added debug logging
dcbickfo f16bff3
Update internal/cmdx/slot.go
dcbickfo c5989bb
Update cacheaside.go
dcbickfo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,162 @@ | ||
| # golangci-lint configuration | ||
| # Documentation: https://golangci-lint.run/usage/configuration/ | ||
|
|
||
| run: | ||
| timeout: 5m | ||
| tests: true | ||
| modules-download-mode: readonly | ||
|
|
||
| # Output configuration | ||
| output: | ||
| formats: | ||
| - format: colored-line-number | ||
| print-issued-lines: true | ||
| print-linter-name: true | ||
| sort-results: true | ||
|
|
||
| linters: | ||
| disable-all: true | ||
| enable: | ||
| # Enabled by default | ||
| - errcheck # Checks for unchecked errors | ||
| - gosimple # Simplify code | ||
| - govet # Reports suspicious constructs | ||
| - ineffassign # Detects ineffectual assignments | ||
| - staticcheck # Staticcheck is a go vet on steroids | ||
| - unused # Checks for unused constants, variables, functions and types | ||
|
|
||
| # Additional recommended linters | ||
| - gofmt # Checks whether code was gofmt-ed | ||
| - goimports # Check import statements are formatted according to goimport command | ||
| - misspell # Finds commonly misspelled English words | ||
| - revive # Fast, configurable, extensible, flexible, and beautiful linter for Go | ||
| - gocyclo # Computes cyclomatic complexities | ||
| - goconst # Finds repeated strings that could be replaced by a constant | ||
| - gosec # Inspects source code for security problems | ||
| - unconvert # Remove unnecessary type conversions | ||
| - unparam # Reports unused function parameters | ||
| - nakedret # Finds naked returns in functions greater than a specified length | ||
| - gocognit # Computes cognitive complexities | ||
| - godot # Check if comments end in a period | ||
| - whitespace # Detection of leading and trailing whitespace | ||
| - gci # Controls Go package import order and makes it deterministic | ||
|
|
||
| linters-settings: | ||
| goimports: | ||
| # Use goimports as the formatter | ||
| local-prefixes: github.com/dcbickfo/redcache | ||
|
|
||
| gofmt: | ||
| # Simplify code: gofmt with `-s` option | ||
| simplify: true | ||
|
|
||
| gocyclo: | ||
| # Minimal cyclomatic complexity to report | ||
| min-complexity: 15 | ||
|
|
||
| gocognit: | ||
| # Minimal cognitive complexity to report | ||
| min-complexity: 15 | ||
|
|
||
| goconst: | ||
| # Minimal length of string constant | ||
| min-len: 3 | ||
| # Minimum occurrences to report | ||
| min-occurrences: 3 | ||
|
|
||
| gosec: | ||
| # Exclude some checks | ||
| excludes: | ||
| - G104 # Audit errors not checked (we use errcheck for this) | ||
|
|
||
| revive: | ||
| confidence: 0.8 | ||
| rules: | ||
| - name: blank-imports | ||
| - name: context-as-argument | ||
| - name: context-keys-type | ||
| - name: dot-imports | ||
| - name: error-return | ||
| - name: error-strings | ||
| - name: error-naming | ||
| - name: exported | ||
| - name: if-return | ||
| - name: increment-decrement | ||
| - name: var-naming | ||
| - name: var-declaration | ||
| - name: package-comments | ||
| - name: range | ||
| - name: receiver-naming | ||
| - name: time-naming | ||
| - name: unexported-return | ||
| - name: indent-error-flow | ||
| - name: errorf | ||
| - name: empty-block | ||
| - name: superfluous-else | ||
| - name: unused-parameter | ||
| - name: unreachable-code | ||
| - name: redefines-builtin-id | ||
|
|
||
| nakedret: | ||
| # Make an issue if func has more lines of code than this setting and has naked return | ||
| max-func-lines: 30 | ||
|
|
||
| unparam: | ||
| # Check exported functions | ||
| check-exported: false | ||
|
|
||
| whitespace: | ||
| multi-if: false | ||
| multi-func: false | ||
|
|
||
| gci: | ||
| # Section configuration to compare against | ||
| sections: | ||
| - standard # Standard section: captures all standard packages | ||
| - default # Default section: contains all imports that could not be matched to another section type | ||
| - prefix(github.com/dcbickfo/redcache) # Custom section: groups all imports with the specified Prefix | ||
|
|
||
| issues: | ||
| # Excluding configuration per-path, per-linter, per-text and per-source | ||
| exclude-rules: | ||
| # Exclude some linters from running on tests files | ||
| - path: _test\.go | ||
| linters: | ||
| - gocyclo | ||
| - gocognit | ||
| - errcheck | ||
| - gosec | ||
| - unparam | ||
| - revive | ||
| - goconst | ||
| - godot | ||
| - whitespace | ||
| - gci | ||
|
|
||
| # Exclude known issues in vendor | ||
| - path: vendor/ | ||
| linters: | ||
| - all | ||
|
|
||
| # Ignore "new" parameter name shadowing built-in | ||
| - text: "redefines-builtin-id" | ||
| linters: | ||
| - revive | ||
|
|
||
| # Ignore integer overflow in CRC16 - this is intentional and safe | ||
| - text: "G115.*integer overflow" | ||
| path: internal/cmdx/slot.go | ||
| linters: | ||
| - gosec | ||
|
|
||
| # Maximum issues count per one linter | ||
| max-issues-per-linter: 50 | ||
|
|
||
| # Maximum count of issues with the same text | ||
| max-same-issues: 3 | ||
|
|
||
| # Show only new issues | ||
| new: false | ||
|
|
||
| # Fix found issues (if it's supported by the linter) | ||
| fix: false |
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
The imported 'log' package is not used in the example code. Consider removing this unused import.