Skip to content

Commit

Permalink
atlasaction: move template test to testscript
Browse files Browse the repository at this point in the history
  • Loading branch information
giautm committed Dec 18, 2024
1 parent a54a483 commit a498aab
Show file tree
Hide file tree
Showing 5 changed files with 355 additions and 401 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,6 @@ lib/**/*

# IDE files
.idea/

# the binary file for the atlas-action
atlas-action
4 changes: 2 additions & 2 deletions atlasaction/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,7 @@ func appliedStmts(a *atlasexec.MigrateApply) int {
var (
//go:embed comments/*.tmpl
comments embed.FS
commentsTmpl = template.Must(
CommentsTmpl = template.Must(
template.New("comments").
Funcs(template.FuncMap{
"execTime": execTime,
Expand Down Expand Up @@ -1162,7 +1162,7 @@ var (
// RenderTemplate renders the given template with the data.
func RenderTemplate(name string, data any) (string, error) {
var buf bytes.Buffer
if err := commentsTmpl.ExecuteTemplate(&buf, name, data); err != nil {
if err := CommentsTmpl.ExecuteTemplate(&buf, name, data); err != nil {
return "", err
}
return buf.String(), nil
Expand Down
Loading

0 comments on commit a498aab

Please sign in to comment.