Go - Alias

Card Puncher Data Processing


Aliasing also occurs when:

  • we take the address of a variable or copy a pointer, we create new aliases or ways to identify the same variable. For example, *p is an alias for v.
  • we copy values of reference types like slices, maps, and channels, and even structs, arrays, and interfaces that contain these types.

Aliasing is useful because it allows us to access a variable without using its name, but this is a double-edged sword: to find all the statements that access a variable, we have to know all its aliases.

Discover More
Card Puncher Data Processing
Go - Pointer

in Go In Go, Pointers are explicitly visible. The & operator yields the address of a variable, and the operator retrieves the variable that the pointer refers to but there is no pointer arithmetic....

Share this page:
Follow us:
Task Runner