File tree 5 files changed +44
-1
lines changed
5 files changed +44
-1
lines changed Original file line number Diff line number Diff line change
1
+ module aniket-batabyal.com/moshimoshi
2
+
3
+ go 1.20
4
+
5
+ replace aniket-batabyal.com/greetings => ../greetings
6
+
7
+ require aniket-batabyal.com/greetings v0.0.0-00010101000000-000000000000
Original file line number Diff line number Diff line change
1
+ package main
2
+
3
+ import (
4
+ "fmt"
5
+
6
+ "aniket-batabyal.com/greetings"
7
+ )
8
+
9
+ func main () {
10
+ fmt .Println ("Moshi Moshi guys!" )
11
+ fmt .Println (greetings .GreetUser ("Aniket" ))
12
+ }
Original file line number Diff line number Diff line change
1
+ module aniket-batabyal.com/greetings
2
+
3
+ go 1.20
Original file line number Diff line number Diff line change
1
+ package greetings
2
+
3
+ import "fmt"
4
+
5
+ // function names starting with Capital letters are called exported names
6
+
7
+ func GreetUser (name string ) string {
8
+ message := fmt .Sprintf ("Hey, welcome to my channel %v" , name )
9
+ return message
10
+ }
Original file line number Diff line number Diff line change 1
1
# learn_golang
2
- This consists of all the codes in the golang tutorial -> https://go.dev/doc/tutorial/
2
+
3
+ This consists of all the codes in the golang tutorial -> < https://go.dev/doc/tutorial/ >
4
+
5
+
6
+ * Things that I have learnt
7
+ * How to create a go file
8
+ * Step 1: Create a folder ` mkdir <folderName> `
9
+ * Step 2: Go inside that folder & run cmd as ` go mod init <domain>/<packageName> `
10
+ * Step 3: Create a go module by creating a new file ` [fileName].go `
11
+ * Step 4: Write some basic go code in it and to run it type ` go run . ` or ` go run <fileName> `
12
+
13
+ * [ TBD]
You can’t perform that action at this time.
0 commit comments