Skip to content

Instantly share code, notes, and snippets.

View aichaoxy's full-sized avatar
😀
Work & Enjoy!

Chao Ai aichaoxy

😀
Work & Enjoy!
  • Tencent Holdings Ltd.
  • 02:51 (UTC +08:00)
View GitHub Profile
@aichaoxy
aichaoxy / ThisIsGo.go
Last active October 23, 2023 09:00
Golang Is Shit E002
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
type BodyPrinter struct {
}
@aichaoxy
aichaoxy / GISE001_correct.go
Created May 19, 2023 02:14
Golang Is Shit E001
package main
import (
"encoding/json"
"fmt"
)
const strListOfNode = `[{"Type":1, "Cpu":1, "Mem":1},{"Type":2, "Cpu":2, "Mem":2}]`
type Node struct {
@aichaoxy
aichaoxy / get_go_routine_id.go
Last active November 13, 2023 03:31 — forked from metafeather/main.go
Get goroutine id for debugging
package main
// 80195: doc/faq: explain why goroutines are anonymous | https://go-review.googlesource.com/c/go/+/80195
// faq: document why there is no way to get a goroutine ID | https://github.com/golang/go/issues/22770
import (
"fmt"
"runtime"
"strconv"
"strings"