wails icon indicating copy to clipboard operation
wails copied to clipboard

[V3] Run `go mod tidy` automatically after `wails init`

Open triadmoko opened this issue 9 months ago • 1 comments

Is your feature request related to a problem? Please describe.

No response

Describe the solution you'd like

After running wails init, the generated project does not automatically perform go mod tidy. As a result, developers need to manually run it to fetch required modules and clean up the go.mod/go.sum files.

Describe alternatives you've considered

The wails init command should automatically run:

go mod tidy

...after the project structure is generated.

Additional context

Benefits:

  • Improves developer experience and reduces friction for new users.
  • Prevents errors during the first build due to missing dependencies.
  • Ensures a clean and consistent go.mod and go.sum.

Steps to Reproduce:

Run wails init

  1. Open the project directory
  2. Try to run wails dev or go run .
  3. Notice missing dependencies unless go mod tidy is run manually

Proposed Solution:

Add a call to go mod tidy as the final step in the init process. This could be done via exec.Command("go", "mod", "tidy") in the Go code, or appropriate shell execution logic.

triadmoko avatar May 15 '25 10:05 triadmoko

I am willing to do it

triadmoko avatar May 15 '25 17:05 triadmoko