-
Notifications
You must be signed in to change notification settings - Fork 57
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
Fix vendoring for golang-http #83
Conversation
7ad3f59
to
f1b01c6
Compare
Tested with a private Go module which was vendored, setting GO111MODULE: off in build_args in stack.yml I also created a nested package called pkg and referenced it as "handler/function/pkg" from handler.go which worked as expected. Closes: #78 Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
f1b01c6
to
cde0ec0
Compare
https://www.diffchecker.com/lhoTkAHq shall we keep remove_workspaces for ./function/go.work? does the arm build still break? |
@@ -26,13 +26,16 @@ ENV CGO_ENABLED=${CGO_ENABLED} | |||
# Run a gofmt and exclude all vendored code. | |||
RUN test -z "$(gofmt -l $(find . -type f -name '*.go' -not -path "./vendor/*" -not -path "./function/vendor/*"))" || { echo "Run \"gofmt -s -w\" on your Golang code"; exit 1; } | |||
|
|||
RUN sh ./modules-cleanup.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
found it, gotta do the shell script right before test -z
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for reference, see here old format file; https://github.com/openfaas/golang-http-template/pull/81/files#diff-cab65cb33a949d149a9235a974191f15e1b6c43367b5301c9fd77cc59c396897; this last tested one as working
@mrwormhole sorry, what question are you asking? |
@alexellis is ARM build running successfully? before the changes, we did run modules-cleanup.sh right before test -z command also second thing, dockerignore file should point to |
Why? There is no repo in openfaas-incubator? That's deprecated. |
This is now available for pinning: https://github.com/openfaas/golang-http-template/releases/tag/0.8.0 cc @willfore - this change makes vendoring private Go modules possible again with golang-http. |
Signed-off-by: Alex Ellis (OpenFaaS Ltd) [email protected]
Description
Fix vendoring for golang-http by reverting to method prior to workspaces
How Has This Been Tested?
Tested with a private Go module which was vendored, setting GO111MODULE: off in build_args in stack.yml
I also created a nested package called pkg and referenced it as "handler/function/pkg" from handler.go which worked as expected.
Closes: #78
How are existing users impacted? What migration steps/scripts do we need?
Imports remained the same, but we will need to check docs and blog posts
https://www.openfaas.com/blog/golang-deep-dive/
https://github.com/openfaas/golang-http-template#20-golang-http
Checklist:
I have:
git commit -s
For the privately vendor code:
For using Go modules w/o any vendoring:
The stack.yml file was unchanged.