Start learning free

LESSON 11 OF 671 · VARIABLES

Variable Naming Rules in Go

Lesson

Variable names should be valid and easy to understand.

In Go, a variable name can contain letters, digits, and underscores, but it cannot start with a digit.

firstName := "John"
isEmployed := true
yearsOfExperience := 5

Go code commonly uses camelCase for local variable names, such as firstName and yearsOfExperience.

Variable names are case-sensitive: name, Name, and NAME are different identifiers.


Assignment
Follow the Coding Tutorial and create variables with clear names.


Hint
Use descriptive camelCase names.


STEP 1 OF 3
    Ctrl + Enter to check