mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 02:54:20 +00:00
f680dd934d
* chore: rename package errors to zerrors * rename package errors to gerrors * fix error related linting issues * fix zitadel error assertion * fix gosimple linting issues * fix deprecated linting issues * resolve gci linting issues * fix import structure --------- Co-authored-by: Elio Bischof <elio@zitadel.com>
20 lines
482 B
Go
20 lines
482 B
Go
package domain
|
|
|
|
import (
|
|
"io"
|
|
"text/template"
|
|
|
|
"github.com/zitadel/zitadel/internal/zerrors"
|
|
)
|
|
|
|
func renderURLTemplate(w io.Writer, tmpl string, data any) error {
|
|
parsed, err := template.New("").Parse(tmpl)
|
|
if err != nil {
|
|
return zerrors.ThrowInvalidArgument(err, "DOMAIN-oGh5e", "Errors.User.InvalidURLTemplate")
|
|
}
|
|
if err = parsed.Execute(w, data); err != nil {
|
|
return zerrors.ThrowInvalidArgument(err, "DOMAIN-ieYa7", "Errors.User.InvalidURLTemplate")
|
|
}
|
|
return nil
|
|
}
|