Go for Beginners — Part 4

Print Method

fmt.Println("Println", "formats", "really well")
fmt.Println("Right?")
Println formats really well
Right?
fmt.Print("The answer is", ": ")
fmt.Print("12")
The answer is: 12
fmt.Print("Print","is","different")
fmt.Print("See?")
PrintisdifferentSee?

Printf Method

selection1 := "soup"
selection2 := "salad"
fmt.Printf("Do I want %v or %v?", selection1, selection2)

Sprint + Sprintln Methods

variableOne := "bruhMomento"
bruhMoment := fmt.Sprintln("Oh god hes even including variables in this such as",variableOne,"look at him go")
template := "I wish I had a %v."
pet := "puppy"
wish := fmt.Sprintf(template,pet)

Getting User Input with Scan()

fmt.Println("How are you doing?")var response stringfmt.Scan(&response)fmt.Printf("My response was %v", response)

Summary

--

--

--

Backend Developer, Probably listening to music and drinking coffee

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Closures in Swift

How to provide Elasticity To Hadoop using Python Automation

Use Data Analytics (KNIME) to set up a Production Plan system using KANBAN and IUNGO

Download data from google cloud storage (gcs) using Talend

Angular JS: Online Calculator Part 2

Azure Data Lake Store Gen2 Snapshot

Centralizing Your Docker Dependencies

Soundness & Generics in Dart — Part II

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Kodey Thomas

Kodey Thomas

Backend Developer, Probably listening to music and drinking coffee

More from Medium

Blockchain in Golang using Docker

Build a REST API with Golang and MongoDB — Gin-gonic Version

Part 1: Becoming Golang developer — Basic of Golang

Flexibility of defining var in golang