Golang Comments

Go programming supports two kinds of comments. The single line will start with //, and the general or multiple lines will begin with /* and end with */. The following Golang example shows you the single and multi-line comments in a real-time example.

package main

import "fmt"

func main()  {
    var x string = "Hello World" // Variable Declaration
    fmt.Println(x) //Printing x value

    ----This is Multi-Line 

    y := 100 /* General Comment*/
Golang Go Comments Example

About Suresh

Suresh is the founder of TutorialGateway and a freelance software developer. He specialized in Designing and Developing Windows and Web applications. The experience he gained in Programming and BI integration, and reporting tools translates into this blog. You can find him on Facebook or Twitter.