Skip to content

dbrucknr/Golang-Design-Patterns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Golang-Design-Patterns

Notes:

  • If you encounter a & prefix to a variable, it indicates the creation of a new pointer to that variable's location in memory.
    • In Go, the & is the address-of operator, which returns the memory address of a variable
x := 10
p := &x // p now holds the memory address of x
  • If you encounter a * prefix to a variable, it indicates the use of a pointer to access the value it points to.
  • When used in an expression (e.g., *p), it retrieves the value stored at the address the pointer holds.
  • When used in a type declaration (e.g., var p *int), it indicates that the variable is a pointer to that type.
    • In Go, the * is the dereference operator, which returns the value stored at the memory address pointed to by a pointer.
x := 10
p := &x
fmt.Println(*p) // prints 10
*p = 20         // updates x through the pointer
  • To run: go run ./cmd/web

    • To make use of template cache: go run ./cmd/web -use-cache
  • Visit: http://localhost:4000/

  • go test -v -count=1 . (Run tests without a cache)

  • go test -v .

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages