Several methods in the vaultik package write directly to os.Stdout instead of using the injectable v.Stdout writer. This breaks the TestVaultik testing infrastructure which captures output via buffers.
Affected methods:
ListSnapshots - uses tabwriter.NewWriter(os.Stdout, ...) and json.NewEncoder(os.Stdout)
Inconsistent behavior: some methods use v.Stdout, others bypass it
Fix
Replace all os.Stdout references with v.Stdout and fmt.Printf/fmt.Println with fmt.Fprintf(v.Stdout, ...).
## Bug
Several methods in the `vaultik` package write directly to `os.Stdout` instead of using the injectable `v.Stdout` writer. This breaks the `TestVaultik` testing infrastructure which captures output via buffers.
Affected methods:
- `ListSnapshots` - uses `tabwriter.NewWriter(os.Stdout, ...)` and `json.NewEncoder(os.Stdout)`
- `PurgeSnapshots` - uses `fmt.Println`, `fmt.Printf`, `fmt.Scanln`
- `VerifySnapshotWithOptions` - uses `fmt.Printf` directly
- `outputPruneBlobsJSON` - package-level function uses `os.Stdout`
- `outputRemoveJSON` - uses `json.NewEncoder(os.Stdout)`
- `ShowInfo` - uses `fmt.Printf` throughout
## Impact
- Output cannot be captured in tests
- Output cannot be redirected programmatically
- Inconsistent behavior: some methods use `v.Stdout`, others bypass it
## Fix
Replace all `os.Stdout` references with `v.Stdout` and `fmt.Printf`/`fmt.Println` with `fmt.Fprintf(v.Stdout, ...)`.
clawbot
self-assigned this 2026-02-08 21:01:08 +01:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Bug
Several methods in the
vaultikpackage write directly toos.Stdoutinstead of using the injectablev.Stdoutwriter. This breaks theTestVaultiktesting infrastructure which captures output via buffers.Affected methods:
ListSnapshots- usestabwriter.NewWriter(os.Stdout, ...)andjson.NewEncoder(os.Stdout)PurgeSnapshots- usesfmt.Println,fmt.Printf,fmt.ScanlnVerifySnapshotWithOptions- usesfmt.PrintfdirectlyoutputPruneBlobsJSON- package-level function usesos.StdoutoutputRemoveJSON- usesjson.NewEncoder(os.Stdout)ShowInfo- usesfmt.PrintfthroughoutImpact
v.Stdout, others bypass itFix
Replace all
os.Stdoutreferences withv.Stdoutandfmt.Printf/fmt.Printlnwithfmt.Fprintf(v.Stdout, ...).