Menu
×
   ❮   
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS DSA TYPESCRIPT SWIFT ANGULAR ANGULARJS GIT POSTGRESQL MONGODB ASP AI R GO KOTLIN SWIFT SASS VUE GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE INTRO TO PROGRAMMING HTML & CSS BASH RUST

Go Keywords


Go Keywords

Go has keywords that are reserved words that cannot be used as variable names, function names, or any other identifiers. You will learn more about each of these keywords in later chapters. Go keywords are:

Keyword Description
break Used to break out of a loop
case Used in conditional statements with switch
chan Used to declare a channel
const Used to declare a constant variable
continue Used to continue to the next iteration of a loop
default Used in conditional statements with switch
defer Defers the execution of a function until the end of the surrounding function
else Used in conditional statements
fallthrough Used in conditional statements with switch
for Used to create a loop
func Used to define a function
Go Used to start the execution of a function call as an independent concurrent thread
Goto Used to jump to the statement with the corresponding label within the same function.
if Used to make a conditional statement
import Used to import a package
Interface Is an abstract type
maps Maps keys to values
package Used to define which package a .go file belongs to.
range Used in for loops
return Used to exit a function and return a value
select Used in conditional statements It looks similar to a "switch" statement but with the cases all referring to communication operations.
struct Used to declare a structure
switch Used in conditional statements
type Used to create a new data type
var Used to declare variables.

×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
sales@w3schools.com

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
help@w3schools.com

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookies and privacy policy.

Copyright 1999-2025 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.