Go Comments

Go programming supports two kinds of comments. The single-line comment will start with //, and the general or multiple line comments 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 
    Commnet
    */

    y := 100 /* General Comment*/
    fmt.Println(y)
}
Go Comments 1