Skip to content
Justice Tech School

Go Syntax and Comments

Every Go file starts with a package line. Execution begins in func main of package main. Statements end at the line break, so semicolons are not needed. // starts a single line comment and /* */ a block comment.

Example
package main

import "fmt"

func main() {
	// single line comment
	fmt.Println("Hello") /* inline block */
}

Result

Hello

Exercise

Start a single line comment.

 this is a comment

Quiz Test

Where does a Go program start?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.