A faster way to create a .go
file with basic structure, imports, and function stubs.
- Quickly scaffold a new Go file with:
- File name prompt
- Imports (space separated)
- Function stubs (space separated)
- Prevents overwriting existing files
- Adds a comment with project info
-
Initialize Go modules (if not already):
go mod init go_houdini
-
Build the script:
go build -o go_houdini.exe houdini.go
-
Run the script:
./go_houdini.exe
Follow the prompts to enter:
- The file name (no need to add
.go
) - Packages to import (space separated, or press Enter to skip)
- Function names (space separated, or press Enter to skip)
- The file name (no need to add
-
The script will generate a Go file with the specified structure.
To use go_houdini
from any terminal window:
-
Copy
go_houdini.exe
to a folder, e.g.,C:\tools\go_houdini
. -
Add this folder to your system
PATH
:- Press
Win + R
, typesysdm.cpl
, and press Enter. - Go to the Advanced tab and click Environment Variables.
- Under System variables, select
Path
and click Edit. - Click New and add
C:\tools\go_houdini
. - Click OK to save.
- Press
-
Open a new terminal and run:
go_houdini
Now you can use go_houdini
from any