- Go programmers typically keep all their Go code in a single workspace.
- A workspace contains many version control repositories (managed by Git, for example).
- Each repository contains one or more packages.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| |----------------------------------------------------------------------------------------|--------------------| | |
| | Object Header (64 bits) | State | | |
| |-------------------------------------------------------|--------------------------------|--------------------| | |
| | Mark Word (32 bits) | Klass Word (32 bits) | | | |
| |-------------------------------------------------------|--------------------------------|--------------------| | |
| | identity_hashcode:25 | age:4 | biased_lock:1 | lock:2 | OOP to metadata object | Normal | | |
| |-------------------------------------------------------|--------------------------------|--------------------| | |
| | thread:23 | epoch:2 | age:4 | biased_lock:1 | lock:2 | OOP to metadata object | Biased | | |
| |-------------------------------------------------------|--------------------------------|--------------------| | |
| | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "context" | |
| "flag" | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "os" | |
| "os/signal" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "io" | |
| "net/http" | |
| "sync/atomic" | |
| ) | |
| func index() http.Handler { | |
| return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |