Skip to content

baseStyle/golang-internal

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Golang Internal

Go language has many amazing features and syntax, such as how to swap the values of two variables.

package main

import "fmt"

func main() {
    a := 5
    b := 10
    fmt.Println("Before swapping, values of a and b are:", a, b)
    a, b = b, a
    fmt.Println("After swapping, values of a and b are:", a, b)
}

Output:

Before swapping, values of a and b are: 5 10
After swapping, values of a and b are: 10 5

This interesting syntax feature is used to test whether an engineer has enough understanding of the Go language. But why is this way of exchanging values valid? How is this syntax feature implemented in Go?

The goal of this project is to answer a series of questions like this from the perspective of the underlying implementation in Go, by explaining the source code, including syntax, data structures, and a series of concurrency issues.

Problems

Variable and Keywords

  1. How to Swap the Values of Two Variables
  2. Use New or Make
  3. String literals, Byte and Rune
  4. Struct, Interface, Pointer
  5. How to Use Defer
  6. Panic and Recover

GPM

  1. How Goroutine Works
  2. How to Use Channel
  3. How Context Works

GC

  1. Go Memory Allocate
  2. How Garbage Collector Works?

Map

  1. Map in Go
  2. New One: Slice

Concurrency

  1. Sync.map
  2. More Sync: Sync.pool, Sync.once
  3. Mutex
  4. Waitgroup
  5. Timer

Develop Tools

  1. Gin
  2. Godep

Code Practices

  1. Array
  2. Stack
  3. Linked-List
  4. String
  5. Binary Tree
  6. Binary Search
  7. Graph
  8. Dynamic Programming
  9. Binary Search Tree
  10. Hash Table
  11. Binary
  12. Heap
  13. Trie
  14. Recursion
  15. Matrix

What's more

  1. Go Version Update
  2. What Are Golang Packages?
  3. Is Golang Case sensitive or Insensitive?
  4. Return Multiple Values From A Function in Go?
  5. Type Assertion in Go
  6. How Is GoPATH Different From GoROOT Variables In Go?
  7. In Go, Are There Any Good Error Handling Practices?
  8. Expressions. Diff b/w Curly Brackets and Square Brackets?

About

This project features optimized Go language, expert source code, concurrent processing, and industry-best practices.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published