Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons

© 2026 BraveProgrammer. All rights reserved.

  1. Courses
  2. /
  3. Go Programming Bootcamp

Lesson 4 of 60 · Go

Primitive Types & Constants

Duration: 15 minutes

Primitive Types & Constants

Go has a small set of fundamental types, which makes the language easier to learn and reason about.

Primitive types

TypeDescription
booltrue/false
stringimmutable UTF-8 text
int, int8, int16, int32, int64signed integers
uint, uint8, uint16, uint32, uint64unsigned integers
float32, float64floating-point numbers
bytealias for uint8
runealias for int32 (Unicode code point)

Go uses int and uint as the default integer types when specific size is not required.

Constants

Constants are values that cannot change after they are declared.

const Pi = 3.14159
const (
    Red   = iota
    Green
    Blue
)

iota is a tool for automatically incrementing constant values within a block.

Info

Untyped constants are flexible and can be used with different numeric types, but a typed constant is required when a specific type is expected.

Previous: Basic Syntax: Packages, Functions, and VariablesNext: Control Flow: if, switch, for Loops