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

Compile and Run

String

Types and Values

Branching and Loop

Data Structure

Function

Misc

Examples

Reference