Implemented a basic scanner
All checks were successful
/ test (push) Successful in 17s

This commit is contained in:
Eduard Urbach 2025-06-19 15:17:50 +02:00
parent df92f55df6
commit 154893d9f7
Signed by: akyoto
GPG key ID: 49226B848C78F6C8
19 changed files with 410 additions and 11 deletions

42
src/fs/bench_test.go Normal file
View file

@ -0,0 +1,42 @@
package fs_test
import (
"os"
"testing"
"git.urbach.dev/cli/q/src/fs"
"git.urbach.dev/go/assert"
)
func BenchmarkReadDir(b *testing.B) {
for b.Loop() {
files, err := os.ReadDir(".")
assert.Nil(b, err)
for _, file := range files {
func(string) {}(file.Name())
}
}
}
func BenchmarkReaddirnames(b *testing.B) {
for b.Loop() {
f, err := os.Open(".")
assert.Nil(b, err)
files, err := f.Readdirnames(0)
assert.Nil(b, err)
for _, file := range files {
func(string) {}(file)
}
f.Close()
}
}
func BenchmarkWalk(b *testing.B) {
for b.Loop() {
err := fs.Walk(".", func(string) {})
assert.Nil(b, err)
}
}