WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

Go - Basic Syntax


Go program consists of various tokens.token is likewise a keyword, an identifier, a constant, a string literal, or a symbol. For example, the following Go statement consists of six tokens

fmt.Println("Hello, World Welookups!")
The individual tokens are
fmt
.
Println
(
   "Hello, World Welookups!"
)

Line Separator

Go program, the line separator key is a statement terminator. individual statements don't need a special separator like ";$ in C.

Example

fmt.Println("Hello, World Welookups!")
fmt.Println("I am in Go Programming!")

Comments

Comments are like helping texts in your Go program and they are ignored by the compiler. Go comment start with /* and terminates with the characters */
/* my first program in Go */

Identifiers

Go identifier is a name used to identify a function, variable,or any other user-defined item.

Keywords

There are following list the reserved words in Go.
break default func interface select
case defer Go map Struct
chan else Goto package Switch
const fallthrough if range Type
continue for import return Var