We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ca59928 commit cfaf283Copy full SHA for cfaf283
codes/ch2_functions/.gitkeep
codes/ch2_functions/function.go
@@ -0,0 +1,31 @@
1
+package main
2
+
3
+import "fmt"
4
5
+/**
6
+ * User defined type Profile act as struct type
7
+ */
8
+type Profile struct {
9
+ name string
10
+ username string
11
+ message string
12
+}
13
14
15
+ * Define a Greeting function;
16
17
+func Greeting(github Profile) {
18
+ fmt.Println("Name: ", github.name)
19
+ fmt.Println("Username: ", github.username)
20
+ fmt.Println("Message: ", github.message)
21
22
23
+func main() {
24
25
+ var github = Profile{"Ashwin Hegde", "hegdeashwin", "Welcome to Go world!"}
26
27
+ /**
28
+ * Call the function and pass the data to the function
29
30
+ Greeting(github)
31
0 commit comments