A modern, fast file search tool that replaces the outdated locate command with real-time file system searching.
Traditional locate has several limitations:
- ❌ Relies on stale database (
updatedb) - ❌ Limited by
updatedb.conffilters - ❌ Name-only searching
- ❌ No real-time file system access
go-locate solves these problems by:
- ✅ Real-time file system scanning
- ✅ No database dependencies
- ✅ Advanced filtering options
- ✅ High-performance Go implementation
- ✅ Single static binary
# Download from releases
curl -L https://github.com/Gosayram/go-locate/releases/latest/download/glocate-linux-amd64 -o glocate
chmod +x glocate
sudo mv glocate /usr/local/bin/
# Or use the install script
curl -sSL https://raw.githubusercontent.com/Gosayram/go-locate/main/install.sh | bash
# Or build from source
git clone https://github.com/Gosayram/go-locate.git
cd go-locate
make build
sudo make install# Basic file search
glocate config.json
# Pattern matching
glocate "*.go"
# Advanced fuzzy search
glocate --advanced "cfg"
# Extension filtering
glocate --ext go,rs,py "main"
# JSON output
glocate --format json "*.md"glocate filename # Find exact filename
glocate "pattern*" # Wildcard search
glocate --advanced substring # Fuzzy matching# Filter by file extension
glocate --ext go,rs,py "main"
# Filter by file size (planned)
glocate --size +100M # Files larger than 100MB
glocate --size -1K # Files smaller than 1KB
# Filter by modification time (planned)
glocate --mtime -7d # Modified in last 7 days
glocate --mtime +1h # Modified more than 1 hour ago
# Exclude/include directories
glocate --exclude /proc,/sys --include /home,/opt "config"
# Search file content (planned)
glocate --content "TODO" --ext goglocate --threads 8 # Use 8 threads (default: CPU cores)
glocate --depth 5 # Limit search depth
glocate --follow-symlinks # Follow symbolic links
glocate --max-results 1000 # Limit number of resultsglocate --format path "*.go" # Simple paths (default)
glocate --format detailed "*.go" # Detailed file info
glocate --format json "*.go" # JSON outputCreate ~/.glocate.toml for default settings:
[search]
exclude_dirs = ["/proc", "/sys", "/dev", "/tmp"]
include_dirs = ["/home", "/opt", "/usr"]
max_depth = 20
follow_symlinks = false
default_threads = 0 # 0 = use CPU count
[output]
format = "path" # or "detailed", "json"
color = true
max_results = 1000Benchmarks on Apple M3 Pro:
| Operation | Time/op | Memory | Allocations |
|---|---|---|---|
| Fuzzy Match (short) | 6.32 ns | 0 B | 0 |
| Fuzzy Match (long) | 16.75 ns | 0 B | 0 |
| Pattern Matching | 297 ns | 0 B | 0 |
| Directory Exclusion | 1158 ns | 0 B | 0 |
| Extension Filtering | 623 ns | 0 B | 0 |
Real-world comparison:
| Tool | Time | Files Found | Notes |
|---|---|---|---|
locate |
0.05s | 234 | Stale database |
find |
2.3s | 456 | Full scan |
glocate |
0.12s | 456 | Real-time + filtering |
- Go 1.24.2+
- Make
# Install dependencies
make deps
# Build binary
make build
# Run tests with benchmarks
make test
make benchmark
# Run all quality checks
make check-all
# Cross-platform build
make build-cross
# Package building (following Go best practices)
make package # Build all packages (binary tarballs, RPM, DEB)
make package-binaries # Create binary tarballs for distribution
make package-rpm # Build only RPM package
make package-deb # Build only DEB package
make package-tarball # Create source distributiongo-locate/
├── cmd/glocate/ # CLI application
├── internal/
│ ├── config/ # Configuration management
│ ├── search/ # Search engine
│ └── output/ # Output formatting
├── .go-version # Go version specification
├── .release-version # Current release version
├── .golangci.yml # Linting configuration
└── Makefile # Build automation
# Run all benchmarks
make benchmark
# Generate benchmark report
make benchmark-report
# Run specific benchmarks
go test -bench=BenchmarkFuzzyMatch ./internal/search/go-locate follows modern Go packaging best practices using pre-compiled binaries:
# Build all packages (binary tarballs, RPM, DEB)
make package
# Individual package types
make package-binaries # Binary tarballs (recommended for distribution)
make package-rpm # RPM for Red Hat/CentOS/Fedora
make package-deb # DEB for Debian/Ubuntu
make package-tarball # Source distributionFor RPM building:
sudo dnf install rpm-build rpmdevtoolsFor DEB building:
sudo apt-get install dpkg-dev fakeroot- Pre-compiled binaries: Uses static binaries instead of building from source
- Multi-architecture support: amd64 and arm64 with automatic detection
- Minimal dependencies: Static binaries with no runtime dependencies
- Distribution compliance: Follows Red Hat and Debian packaging guidelines
- Backward compatibility: Creates
/usr/bin/locate -> glocatesymlink - Proper metadata: Provides, conflicts, and obsoletes declarations
For detailed packaging documentation, see docs/PACKAGING.md.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests and benchmarks
- Run
make check-all - Submit a pull request
MIT License - see LICENSE for details.
- Basic file search with glob patterns
- Advanced fuzzy matching
- Extension filtering
- Directory inclusion/exclusion
- Multiple output formats (path, detailed, JSON)
- Configurable threading
- TOML configuration support
- Cross-platform builds
- Size filtering implementation
- Modification time filtering
- Content search functionality
- Regular expression support
- Shell completion scripts
- GUI interface
- Plugin system
The project uses a multi-layered testing approach:
- Framework: testify v1.10.0
- Coverage: 55.1% overall (100% for version package)
- Features: Structured assertions, table-driven tests, sub-tests
- Go versions: 1.22, 1.23, 1.24.4, 1.24
- Platforms: Ubuntu, macOS, Windows
- Architecture: amd64, arm64 (selected combinations)
- Triggers: Push, PR, scheduled daily, manual dispatch
- Linting: golangci-lint with revive integration
- Static analysis: staticcheck
- Error checking: errcheck
- Security scanning: gosec + govulncheck
- Race detection: Enabled for non-Windows platforms
- Standard CI: Fast feedback on main development workflow
- Matrix Testing: Comprehensive compatibility validation
- Security Scanning: Automated vulnerability detection
- Release Pipeline: Multi-platform binary generation
# Quick tests with testify
make test
# Matrix testing information
make matrix-info
# Check Go version compatibility
make test-go-versions
# Multi-version testing (requires additional Go installations)
make matrix-test-local
# All quality checks
make check-all- Skip failures mode: Non-blocking testing continues even with edge-case failures
- Experimental versions: Optional Go 1.25rc1 testing
- Coverage thresholds: 50% minimum with testify integration
- Integration testing: CLI functionality validation across platforms
- Benchmark matrix: Performance testing across Go versions
For detailed matrix testing documentation, see docs/MATRIX-TESTING.md.