Skip to content

Instantly share code, notes, and snippets.

@hi-manshu
Last active July 12, 2018 15:10
Show Gist options
  • Save hi-manshu/ed8df9b964ef40bc84d64060584f6532 to your computer and use it in GitHub Desktop.
Save hi-manshu/ed8df9b964ef40bc84d64060584f6532 to your computer and use it in GitHub Desktop.
package main
//imported the package fmt
import "fmt"
func main() {
//main function gets called when the program runs
// declared the first variable with datatype string
var firstName string = "Himanshu "
// declared the second variable without any datatype
var secondName = "Singh"
// declared the third variable without any datatype and keyword var to store the new string
fullName := firstName + secondName
// will display the full name in the terminal
fmt.Println(fullName)
}
>>go run stringExample.go
>>Himanshu Singh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment