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

fix: allow sub-pkgs in Go functions #2523

Merged
merged 4 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading