Golang: Comment

By Xah Lee. Date: . Last updated: .

Comment start with 2 slash // to end of line.

or like this

/* something comment can be multiple lines */
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
	*/

}

Reference

The Go Programming Language Specification - The Go Programming Language#Comments

Golang

Examples

Reference