hashicorp / hashicorp/hcl

Updating V1 to V2.6.0 - Decode issues

Open
#398 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
5.8k
Forks
657
Avg merge
20h 36m
Merged PRs (30d)
6

Description

Hey HashiPeople,

I'm currently using V1 for decoding *.tf files to JSON using hcl.Decode as such:
```
func parseHcl(terraformFile string) (interface{}, error) {
var decodedFile interface{}
decodeError := hcl.Decode(&decodedFile, terraformFile)

return decodedFile, decodeError
}
```
I want to update to V2.6.0 mainly to support version 0.12 and greater but I can't seem to find the parallel to that generic hcl.Decode
I tried figuring out hcldec and hclgo Decode functions, but didn't succeed in understanding the additional arguments.

I'd really appreciate your help with that,
Thanks a lot.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by comparing the HCL V1 hcl.Decode usage shown in the issue with the HCL V2.6.0 hcldec and hclgo Decode functions, including their additional arguments. Done means identifying or documenting the supported V2 approach for decoding .tf files to JSON.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
tooling
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.