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
|
- Use build tags for optional compilation
|
||||||
- Add comprehensive tests
|
- Add comprehensive tests
|
||||||
- Handle errors gracefully
|
- 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:**
|
❌ **DON'T:**
|
||||||
- Modify `candidate_node.go` to add format-specific logic
|
- Modify `candidate_node.go` to add format-specific logic
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
//go:build !yq_nohcl
|
||||||
|
|
||||||
package yqlib
|
package yqlib
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
//go:build !yq_nohcl
|
||||||
|
|
||||||
package yqlib
|
package yqlib
|
||||||
|
|
||||||
import (
|
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
|
nonexistent
|
||||||
hclsyntax
|
hclsyntax
|
||||||
hclwrite
|
hclwrite
|
||||||
|
nohcl
|
||||||
zclconf
|
zclconf
|
||||||
cty
|
cty
|
||||||
go-cty
|
go-cty
|
||||||
@ -1,2 +1,2 @@
|
|||||||
#!/bin/bash
|
#!/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
|
#!/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 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