mirror of
https://github.com/numtide/treefmt.git
synced 2024-10-05 21:17:37 +03:00
Update cli/format.go
Co-authored-by: Jonas Chevalier <zimbatm@zimbatm.com>
This commit is contained in:
parent
b2000dc1ec
commit
6776b9f095
@ -417,13 +417,6 @@ func (f *Format) updateCache(ctx context.Context) func() error {
|
|||||||
|
|
||||||
// apply a batch
|
// apply a batch
|
||||||
processBatch := func() error {
|
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
|
// pass the batch to the cache for updating
|
||||||
if err := cache.Update(batch); err != nil {
|
if err := cache.Update(batch); err != nil {
|
||||||
return err
|
return err
|
||||||
@ -432,6 +425,13 @@ func (f *Format) updateCache(ctx context.Context) func() error {
|
|||||||
return nil
|
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:
|
LOOP:
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
|
Loading…
Reference in New Issue
Block a user