package
0.0.0-20240712133535-75229b5999a3
Repository: https://github.com/agarwalconsulting/go-training.git
Documentation: pkg.go.dev

# README

Overview

Pass by ?

  • Go is pass by value always!
  • A few types have pointer fields under the hood
    • Eg.
      • slices
      • maps
      • channels

Pointers

  • p := &<variable>

    • var p *<type>
  • Print address using %p formatter

  • * is used for dereferencing as well as defining a var as pointer

  • & is used to get the address/reference of a variable

  • new builtin function can initialize memory for any type

  • No pointer arithmetic

    • You would have to use package unsafe
  • unsafe is used heavily internally

# Packages

Source: https://stackoverflow.com/questions/38001462/save-pointer-into-a-string-data-structure-in-golang.

# Structs

No description provided by the author
No description provided by the author
No description provided by the author