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

Fresh does not support go mod vendor? #99

Open
developerlaoz opened this issue May 10, 2019 · 3 comments
Open

Fresh does not support go mod vendor? #99

developerlaoz opened this issue May 10, 2019 · 3 comments

Comments

@developerlaoz
Copy link

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 and go 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

@NiloofarGheibi
Copy link

any progress on this issue?

@Mizumaki
Copy link

Mizumaki commented Nov 4, 2019

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: oxequa/realize#217 (comment)

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 ☠️

@kinyat
Copy link

kinyat commented Dec 2, 2019

Thanks @Mizumaki! Your solution works great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants