Skip to content

Commit

Permalink
Fix data.GetJSON examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jmooring authored Jan 18, 2024
1 parent 9029ee1 commit 9e4d03a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions content/en/functions/data/GetJSON.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ my-project/
{{ $data := "" }}
{{ $p := "data/books.json" }}
{{ with resources.Get $p }}
{{ $opts := dict "delimiter" "," }}
{{ $data = . | transform.Unmarshal $opts }}
{{ $data = . | transform.Unmarshal }}
{{ else }}
{{ errorf "Unable to get resource %q" $p }}
{{ end }}
Expand All @@ -113,8 +112,7 @@ my-project/
{{ $data := "" }}
{{ $p := "books.json" }}
{{ with .Resources.Get $p }}
{{ $opts := dict "delimiter" "," }}
{{ $data = . | transform.Unmarshal $opts }}
{{ $data = . | transform.Unmarshal }}
{{ else }}
{{ errorf "Unable to get resource %q" $p }}
{{ end }}
Expand All @@ -131,8 +129,7 @@ Consider using the [`resources.GetRemote`] function with [`transform.Unmarshal`]
{{ with .Err }}
{{ errorf "%s" . }}
{{ else }}
{{ $opts := dict "delimiter" "," }}
{{ $data = . | transform.Unmarshal $opts }}
{{ $data = . | transform.Unmarshal }}
{{ end }}
{{ else }}
{{ errorf "Unable to get remote resource %q" $u }}
Expand Down

0 comments on commit 9e4d03a

Please sign in to comment.