Add more build tags to reduce binary size

This commit is contained in:
Zue
2025-07-01 15:52:40 +08:00
parent a9f7cc1ebb
commit 7696723d5c
18 changed files with 88 additions and 2 deletions
+3
View File
@@ -1,3 +1,6 @@
//go:build !yq_nobase64
package yqlib package yqlib
import ( import (
+3
View File
@@ -1,3 +1,6 @@
//go:build !yq_nocsv
package yqlib package yqlib
import ( import (
+2
View File
@@ -1,3 +1,5 @@
//go:build !yq_noprops
package yqlib package yqlib
import ( import (
+2
View File
@@ -1,3 +1,5 @@
//go:build !yq_nouri
package yqlib package yqlib
import ( import (
+2
View File
@@ -1,3 +1,5 @@
//go:build !yq_nobase64
package yqlib package yqlib
import ( import (
+2
View File
@@ -1,3 +1,5 @@
//go:build !yq_nocsv
package yqlib package yqlib
import ( import (
+2
View File
@@ -1,3 +1,5 @@
//go:build !yq_noprops
package yqlib package yqlib
import ( import (
+2
View File
@@ -1,3 +1,5 @@
//go:build !yq_nosh
package yqlib package yqlib
import ( import (
+2
View File
@@ -1,3 +1,5 @@
//go:build !yq_noshell
package yqlib package yqlib
import ( import (
+2
View File
@@ -1,3 +1,5 @@
//go:build !yq_nouri
package yqlib package yqlib
import ( import (
+11
View File
@@ -0,0 +1,11 @@
//go:build yq_nobase64
package yqlib
func NewBase64Decoder() Decoder {
return nil
}
func NewBase64Encoder() Encoder {
return nil
}
+11
View File
@@ -0,0 +1,11 @@
//go:build yq_nocsv
package yqlib
func NewCSVObjectDecoder(prefs CsvPreferences) Decoder {
return nil
}
func NewCsvEncoder(prefs CsvPreferences) Encoder {
return nil
}
+11
View File
@@ -0,0 +1,11 @@
//go:build yq_noprops
package yqlib
func NewPropertiesDecoder() Decoder {
return nil
}
func NewPropertiesEncoder(prefs PropertiesPreferences) Encoder {
return nil
}
+7
View File
@@ -0,0 +1,7 @@
//go:build yq_nosh
package yqlib
func NewShEncoder() Encoder {
return nil
}
+7
View File
@@ -0,0 +1,7 @@
//go:build yq_noshell
package yqlib
func NewShellVariablesEncoder() Encoder {
return nil
}
+11
View File
@@ -0,0 +1,11 @@
//go:build yq_nouri
package yqlib
func NewUriDecoder() Decoder {
return nil
}
func NewUriEncoder() Encoder {
return nil
}
+7 -1
View File
@@ -257,4 +257,10 @@ noyaml
nolint nolint
shortfile shortfile
Unmarshalling Unmarshalling
noini noini
nocsv
nobase64
nouri
noprops
nosh
noshell
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/bash #!/bin/bash
# Currently, the `yq_nojson` feature must be enabled when using TinyGo. # Currently, the `yq_nojson` feature must be enabled when using TinyGo.
tinygo build -no-debug -tags "yq_nolua yq_noini yq_notoml yq_noxml yq_nojson" . tinygo build -no-debug -tags "yq_nolua yq_noini yq_notoml yq_noxml yq_nojson yq_nocsv yq_nobase64 yq_nouri yq_noprops yq_nosh yq_noshell" .