Update cli/format.go

Co-authored-by: Jonas Chevalier <zimbatm@zimbatm.com>
This commit is contained in:
Brian McGee 2024-07-05 21:23:13 +01:00 committed by GitHub
parent b2000dc1ec
commit 6776b9f095
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -417,13 +417,6 @@ func (f *Format) updateCache(ctx context.Context) func() error {
// apply a batch
processBatch := func() error {
// if we are processing from stdin that means we are outputting to stdout, no caching involved
// if f.NoCache is set that means either the user explicitly disabled the cache or we failed to open on
if f.Stdin || f.NoCache {
// do nothing
return nil
}
// pass the batch to the cache for updating
if err := cache.Update(batch); err != nil {
return err
@ -432,6 +425,13 @@ func (f *Format) updateCache(ctx context.Context) func() error {
return nil
}
// if we are processing from stdin that means we are outputting to stdout, no caching involved
// if f.NoCache is set that means either the user explicitly disabled the cache or we failed to open on
if f.Stdin || f.NoCache {
// do nothing
processBatch := func() error { return nil }
}
LOOP:
for {
select {