TL;DR:
go build -o .bin/example -overlay overlay.json -gcflags="all=-N -l" ./cmd/server/main.go
overlay.json (paraphrasing)
{
"Replace": {
"/.../path/to/file.go": "/.../local/file.go"
}
}
I got the overlay to work, but ran into a problem where because the overlayed file does not reference a library that the overlay file does, I get this. I'm assuming it has to do with symbol load order or something?
../../../../path/to/file.go:6:2: could not import io (open : no such file or directory)
../../../../path/to/file.go:7:2: could not import net/http (open : no such file or directory)
- what's your objective/problem you're trying to solve with it ?