What is Golang type uint?

The uint type in Golang is a numeric type that stores unsigned integers.

The following code snippet illustrates how to define a variable of type uint:

var myVar uint = 100

The following table displays the size of uint type on 32-bit systems and 64-bit systems:

Platform Size Range
32-bit system 32-bit 0 to 232 - 1
64-bit system 64-bit 0 to 264 - 1

Example

The following example demonstrates how to define and print a uint variable:

package main
import "fmt"
func main() {
var myVar uint = 222
fmt.Printf("%d",myVar)
}
New on Educative
Learn to Code
Learn any Language as a beginner
Develop a human edge in an AI powered world and learn to code with AI from our beginner friendly catalog
🏆 Leaderboard
Daily Coding Challenge
Solve a new coding challenge every day and climb the leaderboard

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved