| 
									
										
										
										
											2018-10-13 23:30:21 +03:00
										 |  |  | // Copyright © 2018 Inanc Gumus | 
					
						
							|  |  |  | // Learn Go Programming Course | 
					
						
							|  |  |  | // License: https://creativecommons.org/licenses/by-nc-sa/4.0/ | 
					
						
							|  |  |  | // | 
					
						
							| 
									
										
										
										
											2019-10-30 19:34:44 +03:00
										 |  |  | // For more tutorials  : https://learngoprogramming.com | 
					
						
							|  |  |  | // In-person training  : https://www.linkedin.com/in/inancgumus/ | 
					
						
							|  |  |  | // Follow me on twitter: https://twitter.com/inancgumus | 
					
						
							| 
									
										
										
										
											2018-10-13 23:30:21 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | package main | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | import ( | 
					
						
							|  |  |  | 	"fmt" | 
					
						
							|  |  |  | 	"os" | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // Since, you didn't learn about the control flow statements yet | 
					
						
							|  |  |  | // I didn't include an error detection here. | 
					
						
							|  |  |  | // | 
					
						
							| 
									
										
										
										
											2021-01-02 02:24:25 -05:00
										 |  |  | // So, if you don't pass a name, | 
					
						
							| 
									
										
										
										
											2018-10-13 23:30:21 +03:00
										 |  |  | // this program will fail. | 
					
						
							|  |  |  | // This is intentional. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | func main() { | 
					
						
							|  |  |  | 	var name string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// assign a new value to the string variable below | 
					
						
							|  |  |  | 	name = os.Args[1] | 
					
						
							|  |  |  | 	fmt.Println("Hello great", name, "!") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// changes the name, declares the age with 85 | 
					
						
							| 
									
										
										
										
											2021-01-02 02:24:25 -05:00
										 |  |  | 	name, age := "gandalf", 85 | 
					
						
							| 
									
										
										
										
											2018-10-13 23:30:21 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	fmt.Println("My name is", name) | 
					
						
							|  |  |  | 	fmt.Println("My age is", age) | 
					
						
							|  |  |  | 	fmt.Println("BTW, you shall pass!") | 
					
						
							|  |  |  | } |