Skip to content

Commit 0ace854

Browse files
committed
Add .gitignore into each module
1 parent 7a91dfa commit 0ace854

File tree

9 files changed

+277
-0
lines changed

9 files changed

+277
-0
lines changed

.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,12 @@ original-codes
2424

2525
# Go workspace file
2626
# go.work
27+
28+
# VS Code
29+
.vscode
30+
31+
# Local History for Visual Studio Code
32+
.history/
33+
34+
# Built Visual Studio Code Extensions
35+
.vsix

01-Setup-And-Hello-World/.gitignore

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Project Specific
2+
bin/
3+
bin/*
4+
5+
# If you prefer the allow list template instead of the deny list, see community template:
6+
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
7+
#
8+
# Binaries for programs and plugins
9+
*.exe
10+
*.exe~
11+
*.dll
12+
*.so
13+
*.dylib
14+
15+
# Test binary, built with `go test -c`
16+
*.test
17+
18+
# Output of the go coverage tool, specifically when used with LiteIDE
19+
*.out
20+
21+
# Dependency directories (remove the comment below to include it)
22+
# vendor/
23+
24+
# Go workspace file (remove the comment below to include it)
25+
# go.work
26+
27+
# VS Code
28+
.vscode
29+
30+
# Local History for Visual Studio Code
31+
.history/
32+
33+
# Built Visual Studio Code Extensions
34+
.vsix

01-Setup-And-Hello-World/src/main.go

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ func main() {
1515
fmt.Println("----------------------------")
1616
fmt.Println("Hello world!")
1717
fmt.Printf("Hello again %s!\n", "world")
18+
fmt.Println()
19+
fmt.Println(strings.Repeat("-", 100))
20+
fmt.Println()
1821
}
1922

2023
// AVAILABLE COMMANDS
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Project Specific
2+
bin/
3+
bin/*
4+
5+
# If you prefer the allow list template instead of the deny list, see community template:
6+
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
7+
#
8+
# Binaries for programs and plugins
9+
*.exe
10+
*.exe~
11+
*.dll
12+
*.so
13+
*.dylib
14+
15+
# Test binary, built with `go test -c`
16+
*.test
17+
18+
# Output of the go coverage tool, specifically when used with LiteIDE
19+
*.out
20+
21+
# Dependency directories (remove the comment below to include it)
22+
# vendor/
23+
24+
# Go workspace file (remove the comment below to include it)
25+
# go.work
26+
27+
# VS Code
28+
.vscode
29+
30+
# Local History for Visual Studio Code
31+
.history/
32+
33+
# Built Visual Studio Code Extensions
34+
.vsix

03-Composite-Types/.gitignore

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Project Specific
2+
bin/
3+
bin/*
4+
5+
# If you prefer the allow list template instead of the deny list, see community template:
6+
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
7+
#
8+
# Binaries for programs and plugins
9+
*.exe
10+
*.exe~
11+
*.dll
12+
*.so
13+
*.dylib
14+
15+
# Test binary, built with `go test -c`
16+
*.test
17+
18+
# Output of the go coverage tool, specifically when used with LiteIDE
19+
*.out
20+
21+
# Dependency directories (remove the comment below to include it)
22+
# vendor/
23+
24+
# Go workspace file (remove the comment below to include it)
25+
# go.work
26+
27+
# VS Code
28+
.vscode
29+
30+
# Local History for Visual Studio Code
31+
.history/
32+
33+
# Built Visual Studio Code Extensions
34+
.vsix
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Project Specific
2+
bin/
3+
bin/*
4+
5+
# If you prefer the allow list template instead of the deny list, see community template:
6+
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
7+
#
8+
# Binaries for programs and plugins
9+
*.exe
10+
*.exe~
11+
*.dll
12+
*.so
13+
*.dylib
14+
15+
# Test binary, built with `go test -c`
16+
*.test
17+
18+
# Output of the go coverage tool, specifically when used with LiteIDE
19+
*.out
20+
21+
# Dependency directories (remove the comment below to include it)
22+
# vendor/
23+
24+
# Go workspace file (remove the comment below to include it)
25+
# go.work
26+
27+
# VS Code
28+
.vscode
29+
30+
# Local History for Visual Studio Code
31+
.history/
32+
33+
# Built Visual Studio Code Extensions
34+
.vsix

05-Functions/.gitignore

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Project Specific
2+
bin/
3+
bin/*
4+
5+
# If you prefer the allow list template instead of the deny list, see community template:
6+
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
7+
#
8+
# Binaries for programs and plugins
9+
*.exe
10+
*.exe~
11+
*.dll
12+
*.so
13+
*.dylib
14+
15+
# Test binary, built with `go test -c`
16+
*.test
17+
18+
# Output of the go coverage tool, specifically when used with LiteIDE
19+
*.out
20+
21+
# Dependency directories (remove the comment below to include it)
22+
# vendor/
23+
24+
# Go workspace file (remove the comment below to include it)
25+
# go.work
26+
27+
# VS Code
28+
.vscode
29+
30+
# Local History for Visual Studio Code
31+
.history/
32+
33+
# Built Visual Studio Code Extensions
34+
.vsix

06-Pointers/.gitignore

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Project Specific
2+
bin/
3+
bin/*
4+
5+
# If you prefer the allow list template instead of the deny list, see community template:
6+
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
7+
#
8+
# Binaries for programs and plugins
9+
*.exe
10+
*.exe~
11+
*.dll
12+
*.so
13+
*.dylib
14+
15+
# Test binary, built with `go test -c`
16+
*.test
17+
18+
# Output of the go coverage tool, specifically when used with LiteIDE
19+
*.out
20+
21+
# Dependency directories (remove the comment below to include it)
22+
# vendor/
23+
24+
# Go workspace file (remove the comment below to include it)
25+
# go.work
26+
27+
# VS Code
28+
.vscode
29+
30+
# Local History for Visual Studio Code
31+
.history/
32+
33+
# Built Visual Studio Code Extensions
34+
.vsix

init.sh

+61
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,56 @@ else
5656
echo "";
5757
fi
5858

59+
# Create a .gitignore
60+
if test -f "$PROJECT_DIR/.gitignore"; then
61+
echo "The .gitignore file already exist. Skipping creating a new .gitignore.";
62+
echo "";
63+
else
64+
echo "Creating a new .gitignore file...";
65+
touch ".gitignore";
66+
# Add default placeholder contents
67+
echo "\
68+
# Project Specific
69+
bin/
70+
bin/*
71+
72+
# If you prefer the allow list template instead of the deny list, see community template:
73+
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
74+
#
75+
# Binaries for programs and plugins
76+
*.exe
77+
*.exe~
78+
*.dll
79+
*.so
80+
*.dylib
81+
82+
# Test binary, built with `go test -c`
83+
*.test
84+
85+
# Output of the go coverage tool, specifically when used with LiteIDE
86+
*.out
87+
88+
# Dependency directories (remove the comment below to include it)
89+
# vendor/
90+
91+
# Go workspace file (remove the comment below to include it)
92+
# go.work
93+
94+
# VS Code
95+
.vscode
96+
97+
# Local History for Visual Studio Code
98+
.history/
99+
100+
# Built Visual Studio Code Extensions
101+
.vsix
102+
103+
" >> .gitignore;
104+
105+
echo "Done."
106+
echo "";
107+
fi
108+
59109
# Create a readme.md with placeholder
60110
if test -f "$PROJECT_DIR/readme.md"; then
61111
echo "The readme.md file already exist. Skipping creating a new readme.md.";
@@ -142,6 +192,17 @@ else
142192
echo "";
143193
fi
144194

195+
# Create a new "tests" folder if does not exist yet
196+
if test -d "$PROJECT_DIR/tests"; then
197+
echo "The tests directory exist. Skipping creating a new tests directory.";
198+
echo "";
199+
else
200+
echo "Creating a new tests directory...";
201+
mkdir -p "tests";
202+
echo "Done."
203+
echo "";
204+
fi
205+
145206
# Create a new "main.go" in "src" if does not exist yet
146207
if test -f "$PROJECT_DIR/src/main.go"; then
147208
echo "The main.go file exist. Skipping creating a main.go file.";

0 commit comments

Comments
 (0)