Add func start support for Go#4892
Conversation
liliankasem
left a comment
There was a problem hiding this comment.
We don't need to handle this in this pr, but as a follow up - I have some thoughts about this native -> language resolution/story.
We should refactor how the CLI handles FUNCTIONS_WORKER_RUNTIME=native. native is the host's identifier for any worker registered with language="native" so it isn't really a worker runtime in the same sense as python or node. It's more of a category.
Options to explore:
-
Sidecar setting in local.settings.json (e.g. FUNCTIONS_WORKER_NATIVE_LANGUAGE=go) written by func init and read by every CLI action that branches on language (when FUNCTIONS_WORKER_RUNTIME is native).
-
Subcommand-style language dispatch for start, similar to how init already uses InitNodeSubcommandAction / InitDotnetSubcommandAction to differentiate languages within a runtime.
-
Marker-file detection as a fallback only (current PR's go.mod check) but driven by an explicit setting first.
The goal being that we keep WorkerRuntimeLanguageHelper a pure mapping (no project sniffing), keep native language-agnostic in the helper, and surface a single source of truth that downstream actions (start, pack, publish) can branch on.
Might be worth a conversation about this. But also we don't need to overinvst here with v5 in the works at the moment.
liliankasem
left a comment
There was a problem hiding this comment.
This is fine for now, but before we release the go support preview - we need to have a conversation about go/native support in v5 and make sure the experience in v4 aligns with our future plans to avoid supporting 2 different experiences for native
* Add func start support for Go * Address pr review * Address pr feedback --------- Co-authored-by: Harshitha Akkaraju <hakkaraj@microsoft.com>
Implements func start for the Go worker runtime. Builds the user's Go project and launches the Functions host with the Go worker registered under the native runtime identifier
Build & Launch Flow
the CLI
How it works
1.24, then builds app (or app.exe on Windows)