Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

golang

What is Golang type uint?

Ayesha Naeem

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

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)
}

RELATED TAGS

golang

CONTRIBUTOR

Ayesha Naeem
Copyright ©2022 Educative, Inc. All rights reserved

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring