github.com/TeaOSLab/EdgeNode@v1.3.8/internal/compressions/reader_pool_gzip.go (about) 1 // Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. 2 3 package compressions 4 5 import ( 6 teaconst "github.com/TeaOSLab/EdgeNode/internal/const" 7 "io" 8 ) 9 10 var sharedGzipReaderPool *ReaderPool 11 12 func init() { 13 if !teaconst.IsMain { 14 return 15 } 16 17 sharedGzipReaderPool = NewReaderPool(CalculatePoolSize(), func(reader io.Reader) (Reader, error) { 18 return newGzipReader(reader) 19 }) 20 }