list of keywords in golang

break: The break statement terminates the innermost loop or switch statement.

default: The default keyword is used in a switch statement to specify the code block that should be executed when none of the specified case values match the switch expression.

func: The func keyword is used to declare a function.

interface: The interface keyword is used to declare a set of method signatures that a type must implement to be considered as implementing that interface.

select: The select statement is used to choose which of a set of possible send or receive operations will proceed.

case: The case keyword is used within a switch statement to define individual cases and their corresponding code blocks.

defer: The defer statement is used to schedule a function call to be run after the function that contains it completes execution.

go: The go keyword is used to start a new goroutine, which is a lightweight thread of execution.

map: The map keyword is used to declare a map data structure.

struct: The struct keyword is used to define a composite data type (struct) that groups together variables under a single name.

chan: The chan keyword is used to declare a channel, a communication mechanism that allows one goroutine to send data to another.

else: The else keyword is used in an if statement to specify the code block that should be executed if the condition is false.

goto: The goto statement is used to transfer control to a labeled statement in the same function.

package: The package keyword is used to declare the package to which the current Go file belongs.

switch: The switch statement is used for conditionally executing a block of code based on the value of an expression.

const: The const keyword is used to declare constants.

if: The if statement is used for conditional execution of code based on a specified condition.

range: The range keyword is used in a for loop to iterate over elements of an array, slice, string, map, or channel.

type: The type keyword is used to declare a new type.

continue: The continue statement is used to skip the rest of the code inside a loop for the current iteration and start the next iteration.

import: The import keyword is used to include packages in a Go program.

return: The return statement is used to exit a function and optionally return a value.

var: The var keyword is used to declare variables.

fallthrough: The fallthrough statement is used within a switch statement to transfer control to the next case without evaluating its condition.

nil: The nil keyword is used to represent the zero value or a zero reference for various data types in Go.

panic: The panic keyword is used to terminate the normal execution of a goroutine and starts the panic and recover mechanism.

recover: The recover function is used to regain control of a panicking goroutine and execute deferred functions.