Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use type alias for Template #71

Merged
merged 5 commits into from
Mar 29, 2023
Merged

Conversation

yuri-tceretian
Copy link
Contributor

This PR internalizes the usage of alertmanager's Template and updates all public functions and methods to use the type alias. This is a follow up for #63 (comment)

Copy link
Collaborator

@gotjosh gotjosh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@santihernandezc santihernandezc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pulled your branch and saw we're still importing upstream's template package into ours.

  • default_template.go: Template and FromGlobsare used in the ForTests function. Both of them are already part of our template package.
  • default_template_test.go: This is a test file so I wouldn't worry about it.
  • funcs.go: DefaultFuncs is taken from upstream.
  • template_data.go: There are some public types and functions (ExtendData, TmplText) that use the upstream package.

I don't think the imported types could be a concern, but the ExtendData and TmplText functions would force us to use the upstream package if we want to use them. Is this something that we could run into?

@santihernandezc santihernandezc self-requested a review March 29, 2023 02:51
Copy link
Contributor

@santihernandezc santihernandezc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@yuri-tceretian yuri-tceretian merged commit bd8ae70 into main Mar 29, 2023
@yuri-tceretian yuri-tceretian deleted the yuri-tceretian/template-alias branch March 29, 2023 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants