Golang: Comment

By Xah Lee. Date: . Last updated: .

Single Line Comment

Single line comment start with 2 slash to end of line

// something something

Multi-Line Comment

Multi-line comment start with /* and end with */ . Like this

/* something comment can be multiple lines */

Comment Example

package main

import "fmt"

func main() {

	// this is a comment

	fmt.Println(3)

	/*
	this is a block comment
	can contain multiple lines
	cannot be nested
	*/

}