45 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
		
		
			
		
	
	
			45 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
| 
								 | 
							
								// For more tutorials: https://blog.learngoprogramming.com
							 | 
						||
| 
								 | 
							
								//
							 | 
						||
| 
								 | 
							
								// Copyright © 2018 Inanc Gumus
							 | 
						||
| 
								 | 
							
								// Learn Go Programming Course
							 | 
						||
| 
								 | 
							
								// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
							 | 
						||
| 
								 | 
							
								//
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								package main
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								import "fmt"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								// ---------------------------------------------------------
							 | 
						||
| 
								 | 
							
								// EXERCISE
							 | 
						||
| 
								 | 
							
								//  1. Initialize the name variable
							 | 
						||
| 
								 | 
							
								//     by getting input from the command line
							 | 
						||
| 
								 | 
							
								//
							 | 
						||
| 
								 | 
							
								//  2. Use concatenation operator to concatenate it
							 | 
						||
| 
								 | 
							
								//     with the raw string literal below
							 | 
						||
| 
								 | 
							
								//
							 | 
						||
| 
								 | 
							
								// NOTE
							 | 
						||
| 
								 | 
							
								//  You should concatenate the name variable in the correct
							 | 
						||
| 
								 | 
							
								//  place.
							 | 
						||
| 
								 | 
							
								//
							 | 
						||
| 
								 | 
							
								// EXPECTED OUTPUT
							 | 
						||
| 
								 | 
							
								//  Let's say that you run the program like this:
							 | 
						||
| 
								 | 
							
								//   go run main.go inanç
							 | 
						||
| 
								 | 
							
								//
							 | 
						||
| 
								 | 
							
								//  Then it should output this:
							 | 
						||
| 
								 | 
							
								//   hi inanç!
							 | 
						||
| 
								 | 
							
								//   how are you?
							 | 
						||
| 
								 | 
							
								// ---------------------------------------------------------
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								func main() {
							 | 
						||
| 
								 | 
							
									// uncomment the code below
							 | 
						||
| 
								 | 
							
									// name := "and get the name from the command-line"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
									// replace and concatenate the `name` variable
							 | 
						||
| 
								 | 
							
									// after `hi ` below
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
									msg := `hi CONCATENATE-NAME-VARIABLE-HERE!
							 | 
						||
| 
								 | 
							
								how are you?`
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
									fmt.Println(msg)
							 | 
						||
| 
								 | 
							
								}
							 |