golang resources

Docs

  • How to Write GO Code en cn
  • studygolang.com
  • https://studygolang.com/articles/2989?fr=sidebar

go test case

Command

  • go test ./...: run all test cases in correct directory
  • go test -cover: display test case coverage
  • go test -run Name: run specific golang test case

Composer versions and constraints

  • ~1.2.3 means 1.2.3 <= version < 1.3.0
  • ^1.2.3 means 1.2.3 <= version < 2.0.0

go dep

``` apk add git nano go musl-dev

Gocker

```mermaid sequenceDiagram

Linux proc file system

Directory and file Comment
/proc/N process PID is N
/proc/N/cmdline command start process
/proc/N/cwd link to process current word directory
/proc/N/environ Env var list for process
/proc/N/exe link to process executable command file
/proc/N/fd includes all file desc of process related file
/proc/N/maps process related memory info
/proc/N/mem memory space of current process, not readable
/proc/N/root root directory of process
/proc/N/stat status of process
/proc/N/statm memory status of process
/proc/N/status process status, better than stat and statm
/proc/self/ current process

Union file system

copy-on-write CoW.

Test prestissimo speed up composer

Without prestissimo

Run docker env

``` docker run -it –rm dockercraft/composer

Teamcity

docker run -it --rm --name teamcity \
    -v /var/teamcity/datadir:/data/teamcity_server/datadir \
    -v /var/teamcity/log:/opt/teamcity/logs  \
    -p 8111:8111 \
    jetbrains/teamcity-server

phpunit test guideline

Pattern