Skip to content

Latest commit

 

History

History
20 lines (19 loc) · 1.39 KB

Session-3.md

File metadata and controls

20 lines (19 loc) · 1.39 KB

We started from the next slide: https://go.dev/tour/basics/8

Topics Covered :

  1. Variables
  • In go var statement declares a list of variables and we can define the type in the last.
  1. Variables with initializers
  • var declaration can include initializers, one per variable. And the type can be omitted.
  1. Short variable declarations
  • Inside a func := short assignment statement can be used in place of a var declaration with implicit type.
  1. Basic types
  • We learnt about all the Go's basic types and The int, uint, and uintptr types are usually 32 bits wide on 32-bit systems and 64 bits wide on 64-bit systems. Remember by default it comes with 32 bits and then it gets changed as per your system.
  1. Zero values
  • In GO variables declared without an explicit initial value are given their zero value.
  1. Type conversions
  • The expression T(v) converts the value v to the type T.
  1. Type inference
  • In GO while declaring the variable's type is inferred from the value on the right hand side.

References

Please refer to the examples given in the slide for better understanding.