mirror of
https://github.com/mikefarah/yq.git
synced 2026-03-10 15:54:26 +00:00
Adding HCL no build directive
This commit is contained in:
parent
fa42080148
commit
bd3a647650
@ -136,6 +136,7 @@ Key methods:
|
||||
- Use build tags for optional compilation
|
||||
- Add comprehensive tests
|
||||
- Handle errors gracefully
|
||||
- Add the no build directive, like the xml encoder and decoder, that enables a minimal yq builds. e.g. `//go:build !yq_<format>`. Be sure to also updqate the build_small-yq.sh and build-tinygo-yq.sh to not include the new format.
|
||||
|
||||
❌ **DON'T:**
|
||||
- Modify `candidate_node.go` to add format-specific logic
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
//go:build !yq_nohcl
|
||||
|
||||
package yqlib
|
||||
|
||||
import (
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
//go:build !yq_nohcl
|
||||
|
||||
package yqlib
|
||||
|
||||
import (
|
||||
|
||||
11
pkg/yqlib/no_hcl.go
Normal file
11
pkg/yqlib/no_hcl.go
Normal file
@ -0,0 +1,11 @@
|
||||
//go:build yq_nohcl
|
||||
|
||||
package yqlib
|
||||
|
||||
func NewHclDecoder() Decoder {
|
||||
return nil
|
||||
}
|
||||
|
||||
func NewHclEncoder() Encoder {
|
||||
return nil
|
||||
}
|
||||
@ -268,6 +268,7 @@ tinygo
|
||||
nonexistent
|
||||
hclsyntax
|
||||
hclwrite
|
||||
nohcl
|
||||
zclconf
|
||||
cty
|
||||
go-cty
|
||||
@ -1,2 +1,2 @@
|
||||
#!/bin/bash
|
||||
go build -tags "yq_nolua yq_noini yq_notoml yq_noxml yq_nojson" -ldflags "-s -w" .
|
||||
go build -tags "yq_nolua yq_noini yq_notoml yq_noxml yq_nojson yq_nohcl" -ldflags "-s -w" .
|
||||
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 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 yq_nocsv yq_nobase64 yq_nouri yq_noprops yq_nosh yq_noshell" .
|
||||
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 yq_nohcl" .
|
||||
Loading…
Reference in New Issue
Block a user