Created
March 4, 2023 02:47
-
-
Save niski84/950acbefb12deebe4d57ccc8b713400d to your computer and use it in GitHub Desktop.
windows create new golang project template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal enabledelayedexpansion | |
if "%~1"=="" ( | |
set /p projectname="Please enter a project name: " | |
) else ( | |
set projectname=%~1 | |
) | |
mkdir %projectname% | |
cd %projectname% | |
go mod init %projectname% | |
type nul > %projectname%.go | |
type nul > %projectname%_test.go | |
echo "Project '%projectname%' created successfully!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment