Skip to content

Commit

Permalink
Fix output example
Browse files Browse the repository at this point in the history
  • Loading branch information
drewstinnett committed Feb 20, 2024
1 parent 7828b22 commit 57aed16
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
- name: Test Examples
run: go mod tidy; for EX in $(ls _examples); do go run ./_examples/$EX; done
run: for EX in $(ls _examples); do go run ./_examples/$EX; done
coverage:
runs-on: ubuntu-latest
steps:
Expand Down
5 changes: 1 addition & 4 deletions _examples/gotemplate/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"fmt"

gout "github.com/drewstinnett/gout/v2"
"github.com/drewstinnett/gout/v2/config"
"github.com/drewstinnett/gout/v2/formats/gotemplate"
)

Expand All @@ -24,9 +23,7 @@ func main() {
}
g := gout.New()
g.SetFormatter(gotemplate.Formatter{
Opts: config.FormatterOpts{
"template": "{{ range . }}{{ .FirstName }} {{ .LastName }} is {{ .Age }} years old\n{{ end }}",
},
Template: "{{ range . }}{{ .FirstName }} {{ .LastName }} is {{ .Age }} years old\n{{ end }}",
})
//"template": "{{ range . }}{{ .FirstName }} {{ .LastName }} is {{ .Age }} years old\n{{ end }}",
fmt.Printf("# Format: gotemplate\n## People\n")
Expand Down

0 comments on commit 57aed16

Please sign in to comment.