fix: allow sub-pkgs in Go functions (#2523)

* fix: allow sub-pkgs in Go functions

Signed-off-by: Matej Vašek <matejvasek@gmail.com>

* fixup

Signed-off-by: Matej Vašek <matejvasek@gmail.com>

* fixup

Signed-off-by: Matej Vašek <matejvasek@gmail.com>

* fixup

Signed-off-by: Matej Vašek <matejvasek@gmail.com>

---------

Signed-off-by: Matej Vašek <matejvasek@gmail.com>
This commit is contained in:
Matej Vašek 2024-09-27 03:02:32 +02:00 committed by GitHub
parent e4d9b3d10f
commit 075bc9bed4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 10322 additions and 10321 deletions

File diff suppressed because it is too large Load Diff

View File

@ -49,7 +49,7 @@ if [[ $(go list -f {{.Incomplete}}) == "true" ]]; then
exec /$STI_SCRIPTS_PATH/usage
else
pushd .s2i/builds/last
go get f
go get function
go build -o /opt/app-root/gobinary
popd
popd

View File

@ -111,7 +111,7 @@ func runGo(ctx context.Context, job *Job) (err error) {
}
// Get the dependencies of the function
cmd := exec.CommandContext(ctx, "go", "get", "f")
cmd := exec.CommandContext(ctx, "go", "get", "function")
cmd.Dir = job.Dir()
cmd.Stderr = os.Stderr
cmd.Stdout = os.Stdout

View File

@ -66,7 +66,7 @@ func goBuild(cfg *buildConfig, p v1.Platform) (binPath string, err error) {
}
// Get the dependencies of the function
cmd := exec.CommandContext(cfg.ctx, gobin, "get", "f")
cmd := exec.CommandContext(cfg.ctx, gobin, "get", "function")
cmd.Env = envs
cmd.Dir = cfg.buildDir()
cmd.Stderr = os.Stderr

View File

@ -1,11 +1,11 @@
module s
replace f => ./f
replace function => ./f
go 1.21
require (
f v0.0.0-00010101000000-000000000000
function v0.0.0-00010101000000-000000000000
knative.dev/func-go v0.21.3
)

View File

@ -6,7 +6,7 @@ import (
ce "knative.dev/func-go/cloudevents"
f "f"
f "function"
)
func main() {

View File

@ -1,11 +1,11 @@
module s
replace f => ./f
replace function => ./f
go 1.21
require (
f v0.0.0-00010101000000-000000000000
function v0.0.0-00010101000000-000000000000
knative.dev/func-go v0.21.3
)

View File

@ -6,7 +6,7 @@ import (
"knative.dev/func-go/http"
f "f"
f "function"
)
func main() {

View File

@ -1,11 +1,11 @@
module s
replace f => ./f
replace function => ./f
go 1.21
require (
f v0.0.0-00010101000000-000000000000
function v0.0.0-00010101000000-000000000000
knative.dev/func-go v0.21.3
)

View File

@ -6,7 +6,7 @@ import (
ce "knative.dev/func-go/cloudevents"
f "f"
f "function"
)
func main() {

View File

@ -1,11 +1,11 @@
module s
replace f => ./f
replace function => ./f
go 1.21
require (
f v0.0.0-00010101000000-000000000000
function v0.0.0-00010101000000-000000000000
knative.dev/func-go v0.21.3
)

View File

@ -7,7 +7,7 @@ import (
fhttp "knative.dev/func-go/http"
f "f"
f "function"
)
type fx func(http.ResponseWriter, *http.Request)