AGENTS.md@pkg/utils · git:20260531.2fbe668 · 2026-05-31 · sha256 55a013ca314e284b

AGENTS.md@pkg/utils git:20260531.2fbe668A

Immutable. This exact content is served forever at /api/v1/blob/55a013ca314e284b.

# Utilities

General-purpose utility functions with unit tests.

## Structure

```
utils/
├── utils.go, file.go, network.go, slice.go, string.go, ...
├── reexec/   # Self-reexec for upgrades
├── sets/     # Generic set types (int, string)
└── syncx/    # Generic sync.Map wrapper
```

## Rules

- Every `.go` file must have a corresponding `*_test.go`.
- Use `utils.CheckSingleton()` for thread-safe single init.
- Use `utils.SignalHandler()` to block on SIGTERM/SIGINT.

## Commands

```bash
go test ./pkg/utils/...
```