Created
November 12, 2016 01:35
-
-
Save jegor377/104f3a518727747cd4a4f40e61fcd67c to your computer and use it in GitHub Desktop.
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
if %1.go.==. goto :errorFileName | |
echo package %1>>%1.go | |
echo.>>%1.go | |
echo import "fmt">>%1.go | |
echo.>>%1.go | |
echo func main() {>>%1.go | |
echo fmt.Println("Hello World\n")>>%1.go | |
echo }>>%1.go | |
exit /b | |
:errorFileName | |
echo You didn't type file name. | |
exit /b |
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 | |
if %1.==. goto :errorProjectName | |
set goProjectsDir=D:\Dane\Projekty\Go | |
set projectPath=%cd%\%1Code | |
mkdir %projectPath% | |
set GOPATH=%projectPath% | |
cd /d %projectPath% | |
mkdir %projectPath%\src | |
cd %projectPath%\src | |
mkdir %1 | |
cd %1 | |
createGoFile.bat main | |
exit /b | |
:errorProjectName | |
echo You didn't type project name. | |
exit /b |
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 | |
set GOPATH=%cd% |
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 | |
if %1.==. goto :errorPackageName | |
set packagePath=%GOPATH%\src\%1 | |
mkdir %packagePath% | |
pushd %packagePath% | |
createGoFile.bat %1 | |
popd | |
exit /b | |
:errorPackageName | |
echo You didn't type package name. | |
exit /b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment