Merge pull request #100 from foomo/fix/empty-load

fix: empty gocontemplate load
This commit is contained in:
Kevin Franklin Kim 2025-03-11 17:08:30 +01:00 committed by GitHub
commit a096008783
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View File

@ -437,7 +437,7 @@ You might need to increase your Google Tag Manager API quotas, since they are li
## How to Contribute
Please refer to the [CONTRIBUTING](.gihub/CONTRIBUTING.md) details and follow the [CODE_OF_CONDUCT](.gihub/CODE_OF_CONDUCT.md) and [SECURITY](.github/SECURITY.md) guidelines.
Please refer to the [CONTRIBUTING](.github/CONTRIBUTING.md) details and follow the [CODE_OF_CONDUCT](.github/CODE_OF_CONDUCT.md) and [SECURITY](.github/SECURITY.md) guidelines.
## License

View File

@ -11,12 +11,16 @@ import (
)
func LoadEventParams(ctx context.Context, cfg contemplate.Config) (map[string]map[string]string, error) {
ret := map[string]map[string]string{}
if len(cfg.Packages) == 0 {
return ret, nil
}
parser, err := contemplate.Load(ctx, &cfg)
if err != nil {
return nil, err
}
ret := map[string]map[string]string{}
for _, cfgPkg := range cfg.Packages {
pkg := parser.Package(cfgPkg.Path)
for _, typ := range cfgPkg.Types {