mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-10 04:22:12 +00:00
This PR fixes a few issues related to `vc dev`. 1. Create a default `go.work` file in the cache dir when building the `vercel-dev-server-go` executable 2. Copy the existing `go.mod` file into the cache dir and update any "replace" relative paths 3. Split the "build" logic into separate functions for the legacy "main" package build and the `go.mod` build Additionally, it fixes: 1. `vc build`: pass in `build.env` from `vercel.json` 2. Fix several tests to work with `vc dev` and `vc build` Linear: https://linear.app/vercel/issue/VCCLI-638/vc-dev-go-builder-cant-resolve-workspace-dependencies The user that reported the issue has tested this build and seems to fix their use case: https://github.com/vercel/vercel/issues/9393#issuecomment-1490726785.
13 lines
190 B
Go
13 lines
190 B
Go
package handler
|
|
|
|
import (
|
|
"fmt"
|
|
"net/http"
|
|
"go-work-with-shared/mylib"
|
|
)
|
|
|
|
// Handler function
|
|
func Handler(w http.ResponseWriter, r *http.Request) {
|
|
fmt.Fprintf(w, mylib.Say("hello"))
|
|
}
|