Skip to content

Commit

Permalink
fix: allow sub-pkgs in Go functions (#2523)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
matejvasek authored Sep 27, 2024
1 parent e4d9b3d commit 075bc9b
Show file tree
Hide file tree
Showing 12 changed files with 10,320 additions and 10,319 deletions.
20,609 changes: 10,305 additions & 10,304 deletions generate/zz_filesystem_generated.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/builders/s2i/assemblers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/functions/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/oci/containerize_go.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions templates/go/scaffolding/instanced-cloudevents/go.mod
Original file line number Diff line number Diff line change
@@ -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
)

Expand Down
2 changes: 1 addition & 1 deletion templates/go/scaffolding/instanced-cloudevents/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

ce "knative.dev/func-go/cloudevents"

f "f"
f "function"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions templates/go/scaffolding/instanced-http/go.mod
Original file line number Diff line number Diff line change
@@ -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
)

Expand Down
2 changes: 1 addition & 1 deletion templates/go/scaffolding/instanced-http/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"knative.dev/func-go/http"

f "f"
f "function"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions templates/go/scaffolding/static-cloudevents/go.mod
Original file line number Diff line number Diff line change
@@ -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
)

Expand Down
2 changes: 1 addition & 1 deletion templates/go/scaffolding/static-cloudevents/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

ce "knative.dev/func-go/cloudevents"

f "f"
f "function"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions templates/go/scaffolding/static-http/go.mod
Original file line number Diff line number Diff line change
@@ -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
)

Expand Down
2 changes: 1 addition & 1 deletion templates/go/scaffolding/static-http/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

fhttp "knative.dev/func-go/http"

f "f"
f "function"
)

type fx func(http.ResponseWriter, *http.Request)
Expand Down

0 comments on commit 075bc9b

Please sign in to comment.