kyma-project / modulectl

Internal tool for module management and operations
Apache License 2.0
0 stars 10 forks source link

Refactor `filegenerator` to use functional options for configuration #15

Open c-pius opened 5 months ago

c-pius commented 5 months ago

Description

Right now we have filegenerator and reuse-filegenerator which is a decorator on the former. The more idiomatic way in Go would be to move both into the same package and use functional options to configure reuse on top of the plain file generator.

It may look something like the following:

generator, err := filegenerator.New(
  kind,
  fileSystem,
  contentProvider,
  fileGenerator.WithReuse()
)

Figuring out the proper typing and structuring (e.g., with the decorator pattern) may be tricky.

Reasons

Further increase the quality of the project.

Attachments

github-actions[bot] commented 3 months ago

This issue has been automatically marked as stale due to the lack of recent activity. It will soon be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 3 months ago

This issue has been automatically closed due to the lack of recent activity. /lifecycle rotten