Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cli/module_generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,13 @@ func (c *viamClient) generateModuleAction(ctx context.Context, cmd *cli.Command,
"To access your module in app, make sure to add \"tcp_mode\": true to the module config json\n"+
"and set your local module's executable path to run.bat")
}
if newModule.Language == golang {
tidyCmd := exec.Command("go", "mod", "tidy")
tidyCmd.Dir = newModule.ModuleName
if err := tidyCmd.Run(); err != nil {
return fmt.Errorf("failed to run go mod tidy: %w", err)
}
}
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion cli/module_generate/_templates/go/tmpl-go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module {{.ModuleLowercase}}

go 1.23
go 1.25
Loading