Skip to content

Commit 1854617

Browse files
authored
minor repo cleanup (#352)
1 parent 9144662 commit 1854617

File tree

8 files changed

+11
-13
lines changed

8 files changed

+11
-13
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# CODEOWNERS info: https://help.github.com/en/articles/about-code-owners
22
# Owners are automatically requested for review for PRs that changes code
33
# that they own.
4-
* @joshua-goldstein @mangalaman93 @harshil-goel
4+
* @joshua-goldstein @mangalaman93 @harshil-goel @all-seeing-code

.github/ISSUE_TEMPLATE/documentation_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ body:
1111
- type: textarea
1212
attributes:
1313
label: What version of Ristretto is the target?
14-
description: Is it the latest version?
14+
description: Is it the latest version?
1515
placeholder: |
1616
Type here.
1717
validations:

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ body:
88
value: |
99
Thank you for reporting an issue.
1010
If you think we can make Ristretto better, describe your feature request here.
11-
Note: Feature requests are judged based on user experience and modeled on
12-
[Go Experience Reports](https://github.com/golang/go/wiki/ExperienceReports).
11+
Note: Feature requests are judged based on user experience and modeled on
12+
[Go Experience Reports](https://github.com/golang/go/wiki/ExperienceReports).
1313
These reports should focus on the problems - they should not focus on and need not propose solutions.
1414
- type: dropdown
1515
attributes:

contrib/memtest/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
memtest tests the effect of the C memory allocator. The default version uses Calloc from the stdlib.
1+
memtest tests the effect of the C memory allocator. The default version uses Calloc from the stdlib.
22

33
If the program is built using the `jemalloc` build tag, then the allocator used will be jemalloc.
44

@@ -13,4 +13,4 @@ sleep 1
1313
done
1414
```
1515

16-
This is of course contingent upon the fact that the binary of this program is called `memtest`.
16+
This is of course contingent upon the fact that the binary of this program is called `memtest`.

contrib/memtest/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ func viaLL() {
151151
func main() {
152152
check()
153153
fill = make([]byte, maxMB<<20)
154-
rand.Read(fill)
154+
_, _ = rand.Read(fill)
155155

156156
c := make(chan os.Signal, 10)
157157
signal.Notify(c, os.Interrupt, syscall.SIGTERM)

policy.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ const (
3131
)
3232

3333
// policy is the interface encapsulating eviction/admission behavior.
34-
//
3534
// TODO: remove this interface and just rename defaultPolicy to policy, as we
3635
// are probably only going to use/implement/maintain one policy.
3736
type policy interface {
@@ -346,7 +345,7 @@ func (p *sampledLFU) updateIfHas(key uint64, cost int64) bool {
346345
p.metrics.add(keyUpdate, key, 1)
347346
if prev > cost {
348347
diff := prev - cost
349-
p.metrics.add(costAdd, key, ^uint64(diff-1))
348+
p.metrics.add(costAdd, key, ^(uint64(diff) - 1))
350349
} else if cost > prev {
351350
diff := cost - prev
352351
p.metrics.add(costAdd, key, uint64(diff))

z/allocator_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func TestAllocateConcurrent(t *testing.T) {
137137
mu := new(sync.Mutex)
138138
for i := 0; i < M; i++ {
139139
wg.Add(1)
140-
go func() { //nolint:staticcheck,govet
140+
go func() {
141141
defer wg.Done()
142142
var bufs []uintptr
143143
for j := 0; j < N; j++ {
@@ -149,8 +149,7 @@ func TestAllocateConcurrent(t *testing.T) {
149149
mu.Lock()
150150
for _, b := range bufs {
151151
if _, ok := m[b]; ok {
152-
//nolint:staticcheck,govet
153-
t.Fatalf("Did not expect to see the same ptr")
152+
panic("did not expect to see the same ptr")
154153
}
155154
m[b] = struct{}{}
156155
}

z/flags.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ func (sf *SuperFlag) mergeAndCheckDefaultImpl(flag string) (*SuperFlag, error) {
162162
}
163163
}
164164
if numKeys != 0 {
165-
return nil, fmt.Errorf("superflag: found invalid options in flag: %s.\nvalid options: %v", sf, flag)
165+
return nil, fmt.Errorf("superflag: found invalid options: %s.\nvalid options: %v", sf, flag)
166166
}
167167
for k, v := range src {
168168
if _, ok := sf.m[k]; !ok {

0 commit comments

Comments
 (0)