feat: add example for effective go krm function#602
Merged
yuwenma merged 2 commits intokptdev:masterfrom Nov 4, 2022
Merged
Conversation
3 tasks
1afda17 to
d60b3c0
Compare
d60b3c0 to
f298efc
Compare
f298efc to
692f094
Compare
a0c97fa to
4333efe
Compare
yuwenma
commented
Nov 4, 2022
go/hack/update-license.sh
Outdated
| # and will add them to the theme which is a submodule (bad) | ||
| command -v addlicense || go install github.com/google/addlicense@v1.0.0 | ||
| find . -print0 | xargs "$GOBIN"/addlicense -y 2022 -l apache | ||
| find . -print0 | xargs "$GOBIN"/addlicense -y 2022 -l apache -ignore **/*.yaml |
Contributor
Author
There was a problem hiding this comment.
Skip adding licenses to the .yaml files to avoid the conflict where addlicense adds license to the golden test _expected.yaml while the golden tests fail due to the unexpected diff in _expected.yaml
2a29c3e to
33a5ca7
Compare
33a5ca7 to
3737e89
Compare
justinsb
approved these changes
Nov 4, 2022
| @for f in $(^D); do \ | ||
| (cd $$f; echo "Checking golangci-lint $$f"; \ | ||
| (which $(GOPATH)/bin/golangci-lint || go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.44.2); \ | ||
| (which $(GOPATH)/bin/golangci-lint || go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.50.1); \ |
Contributor
There was a problem hiding this comment.
Nit: I really like using go run where it works - it seems plenty fast enough now. It also works really nicely with go generate.
(No need to fix, just one for the future!)
Contributor
Author
There was a problem hiding this comment.
Thank you! Yeah, go run is more proper in this case in a follow-up PR.
|
|
||
| // TODO: Change to your functionConfig "Kind" name. | ||
| type YourFunction struct { | ||
| FnConfigBool bool |
Contributor
There was a problem hiding this comment.
Q: Do we need json annotations?
Contributor
|
LGTM! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR gives an example to let fn authors to get started by using the fnRunner interface.
kfnfeat: Addkfnas function editor CLI #639 (Eventually I want thekfnto generate the scaffolding code as kubebuilder does)