Allow disabling lzo and lzma

By setting the buildtags "no_lzo" and/or "no_lzma",
one can drop the library dependency on lzo and lzma.

The same could be done for xz as well, but there are
still lots of archives using xz compression out there.
This commit is contained in:
Anders F Björklund
2025-03-16 13:53:42 +01:00
parent 7323fe56f6
commit 04d914d403
4 changed files with 26 additions and 0 deletions
+1
View File
@@ -1,3 +1,4 @@
//go:build !no_lzma
package decompress package decompress
import ( import (
+12
View File
@@ -0,0 +1,12 @@
//go:build no_lzma
package decompress
import (
"fmt"
)
type Lzma struct{}
func (l Lzma) Decompress(_ []byte) ([]byte, error) {
return nil, fmt.Errorf("lzma is not supported")
}
+1
View File
@@ -1,3 +1,4 @@
//go:build !no_lzo
package decompress package decompress
import ( import (
+12
View File
@@ -0,0 +1,12 @@
//go:build no_lzo
package decompress
import (
"fmt"
)
type Lzo struct{}
func (l Lzo) Decompress(_ []byte) ([]byte, error) {
return nil, fmt.Errorf("lzo is not supported")
}