github.com/hashicorp/hcl/v2@v2.20.0/guide/go.rst (about) 1 Using HCL in a Go application 2 ============================= 3 4 HCL is itself written in Go_ and currently it is primarily intended for use as 5 a library within other Go programs. 6 7 This section describes a number of different ways HCL can be used to define 8 and process a configuration language within a Go program. For simple situations, 9 HCL can decode directly into Go ``struct`` values in a similar way as encoding 10 packages such as ``encoding/json`` and ``encoding/xml``. 11 12 The HCL Go API also offers some alternative approaches however, for processing 13 languages that may be more complex or that include portions whose expected 14 structure cannot be determined until runtime. 15 16 The following sections give an overview of different ways HCL can be used in 17 a Go program. 18 19 .. toctree:: 20 :maxdepth: 1 21 :caption: Sub-sections: 22 23 go_parsing 24 go_diagnostics 25 go_decoding_gohcl 26 go_decoding_hcldec 27 go_expression_eval 28 go_decoding_lowlevel 29 go_patterns 30 31 .. _Go: https://golang.org/