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

src: simplify go templates #741

Merged

Conversation

lkingland
Copy link
Member

@lkingland lkingland commented Jan 9, 2022

  • 🧹 Simplify Go templates in an attempt to reduce beginner confusion.

In user interviews it was recommended that we have all complexity in the templates pushed to the bottom, and a large "your code here" callout in the initial function to make the initial experience by developers better. This was also brought up again in #606. This PR proposes a format which, if acceptable, may serve as a template for the other embedded templates as well. There is a more in-depth discussion there as to why this particular function signature was chosen as the default for Cloud Events that may be worth a read for those so inclined.

/kind enhancement

Fixes #606

Simplify Go templates for an easier getting started experience

@knative-prow-robot knative-prow-robot added kind/enhancement size/M Denotes a PR that changes 30-99 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jan 9, 2022
@codecov
Copy link

codecov bot commented Jan 9, 2022

Codecov Report

Merging #741 (45e7743) into main (64ba17b) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #741   +/-   ##
=======================================
  Coverage   41.52%   41.52%           
=======================================
  Files          42       42           
  Lines        4101     4101           
=======================================
  Hits         1703     1703           
  Misses       2145     2145           
  Partials      253      253           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 64ba17b...45e7743. Read the comment docs.

Copy link
Contributor

@zroubalik zroubalik left a comment

Choose a reason for hiding this comment

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

/approve

Looking good

@knative-prow-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lkingland, zroubalik

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [lkingland,zroubalik]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Member

@lance lance left a comment

Choose a reason for hiding this comment

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

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 10, 2022
@knative-prow-robot knative-prow-robot merged commit 4504b21 into knative:main Jan 10, 2022
@lkingland lkingland deleted the lkingland/go-template-docs branch September 20, 2022 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/enhancement lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Simplify Go CE func template signature
4 participants