println in GO Tutorial

Udemy Generic 728x90

Overview

println in go is used to print the string.

 

Package – fmt

Package fmt implements formatted I/O with functions analogous to C’s printf and scanf. The format ‘verbs’ are derived from C’s but are simpler.

 

Description –

Like C’s printf, println is used to print “character, string, float, integer, octal and hexadecimal values”. To use println you have to import I/O package fmt .

 

Syntax

fmt.Println(“Text to print”)

 

The following example shows how to display different strings with the println command:

 


package main

import "fmt"

func main() {

    fmt.Println("Hello Vishal")

}


Udemy Generic 728x90

Spread the word. Share this post!