Skip to content

Commit

Permalink
chore(tool/create-resource): more improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
ekristen committed Jan 4, 2025
1 parent 0c8daf7 commit 2b8a886
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tools/create-resource/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"bytes"
"fmt"
"github.com/iancoleman/strcase"
"os"
"strings"
"text/template"
Expand Down Expand Up @@ -69,7 +70,7 @@ type {{.Combined}} struct {
func (r *{{.Combined}}) Remove(ctx context.Context) error {
_, err := r.svc.Delete{{.ResourceTypeTitle}}(ctx, &{{.Service}}.Delete{{.ResourceTypeTitle}}Input{
{{.ResourceTypeTitle}}Id: r.id,
{{.ResourceTypeTitle}}Id: r.ID,
})
return err
}
Expand Down Expand Up @@ -106,8 +107,8 @@ func main() {
Service: strings.ToLower(service),
ServiceTitle: caser.String(service),
ResourceType: resourceType,
ResourceTypeTitle: caser.String(resourceType),
Combined: fmt.Sprintf("%s%s", caser.String(service), caser.String(resourceType)),
ResourceTypeTitle: strcase.ToCamel(resourceType),
Combined: fmt.Sprintf("%s%s", caser.String(service), strcase.ToCamel(resourceType)),
}

tmpl, err := template.New("resource").Parse(resourceTemplate)
Expand Down

0 comments on commit 2b8a886

Please # to comment.