replace parse with new json parser
This commit is contained in:
parent
cf0da81e50
commit
b3a9867999
4
parse.go
4
parse.go
@ -5,7 +5,7 @@ import (
|
||||
|
||||
"github.com/hashicorp/hcl/hcl/ast"
|
||||
hclParser "github.com/hashicorp/hcl/hcl/parser"
|
||||
"github.com/hashicorp/hcl/json"
|
||||
jsonParser "github.com/hashicorp/hcl/json/parser"
|
||||
)
|
||||
|
||||
// Parse parses the given input and returns the root object.
|
||||
@ -16,7 +16,7 @@ func Parse(input string) (*ast.File, error) {
|
||||
case lexModeHcl:
|
||||
return hclParser.Parse([]byte(input))
|
||||
case lexModeJson:
|
||||
return json.Parse(input)
|
||||
return jsonParser.Parse([]byte(input))
|
||||
}
|
||||
|
||||
return nil, fmt.Errorf("unknown config format")
|
||||
|
Loading…
Reference in New Issue
Block a user