Open developerlaoz opened 5 years ago
any progress on this issue?
It seems fresh
doesn't support go module mode, so I decided to use realize
as an alternative for hot reload development.
My project folder is :
├── server
│ └── main.go
├── go.mod
├── go.sum
└── .realize.yaml (This is the replacement of runner.conf
)
.realize.yaml
is :
settings:
legacy:
force: false
interval: 0s
schema:
- name: name
path: .
commands:
install:
status: true
method: go build -o tmp/app.out server/main.go
run:
status: true
method: tmp/app.out
watcher:
extensions:
- go
paths:
- /
ignore:
paths:
- .git
- .realize
- vendor
ref: https://github.com/oxequa/realize/issues/217#issuecomment-459198990
After installing realize
, realize start
will work fine. 🥳
When you install realize
, you may see this error:
build github.com/oxequa/realize: cannot load gopkg.in/urfave/cli.v2
.
The solution is
go get gopkg.in/urfave/cli.v2@master
GO111MODULE=off go get github.com/oxequa/realize
And please be careful realize
seems dead project the same as fresh
☠️
Thanks @Mizumaki! Your solution works great!
Fresh does not support go mod vendor?
I start a project with go mod. When I build and run my project, I can use
go build -mod=vendor cmd/main.go
andgo run -mod=vendor cmd/main.go
.But I can not use fresh, because the source of build step in fresh is
cmd := exec.Command("go", "build", "-o", buildPath(), root())
.Am I right? How can I use fresh in my project.
My project folder is : ├── cmd │ └── main.go ├── go.mod ├── go.sum ├── internal ├── runner.conf └── vendor