Type Conversion

This lesson discusses the conversion variable types to other inbuilt types using example

We'll cover the following

Converting Values

In the previous lesson, we covered the various types a variable in Go can take. Now, we will discuss how the type of a given variable can be changed. Converting values from one type to another is fairly simple in Go. The expression T(v) converts the value v to the type T.


Given below are some example numeric conversions:

Get hands-on with 1000+ tech skills courses.