Go


  1. h2c 实现grpc与http共用一个端口
  2. 完整可运行的 Middleware 设计
  3. ReadPump会一直阻塞在ReadMessage 是否需要 c.ctx.Done(): c.Session.ctx.Done()
  4. asr-llm-tts
  5. 典型 Go 流式接口设计
  6. golang自己实现了 系统调用所以不需要glibc或musl实现的系统调用
  7. Go module的本地使用
  8. RingBuffer + Offset 消费 避免丢失数据
  9. eventbus
  10. 通俗的解释闭包,以及闭包的应用

export GOROOT=/ssd1/wy/software/go
export GOPROXY=https://goproxy.cn,direct
场景推荐框架
小型 API / 高性能Gin / Fiber / Echo / chi
企业级全栈Beego / Buffalo / Iris
Node.js 风格Fiber
强类型 & 模块化chi
go mod init github.com/yourname/my-go-project
go get -u <module-name>
go mod tidy
go list -m -json github.com/cloudwego/eino-ext/components/model/qwen@latest
go list -m all
go env GOWORK
go work init
go work use ./ai-agent-go
go work use -drop ./parser-go
go work sync
go list -f '\{\{.Dir}}' github.com/minebiome/ai-agent-go/gen/go/article/v1
go clean -modcache
go env GOPROXY
go mod tidy -x
go: github.com/minebiome/news-go/internal/middleware imports
        github.com/minebiome/ai-agent-go/gen/go/trace/v1: github.com/minebiome/ai-agent-go@v0.0.0-20260527090507-ad849fc60c3d: verifying module: github.com/minebiome/ai-agent-go@v0.0.0-20260527090507-ad849fc60c3d: reading https://sum.golang.org/lookup/github.com/minebiome/ai-agent-go@v0.0.0-20260527090507-ad849fc60c3d: 404 Not Found
        server response:
        not found: github.com/minebiome/ai-agent-go@v0.0.0-20260527090507-ad849fc60c3d: invalid version: git ls-remote -q --end-of-options https://github.com/minebiome/ai-agent-go in /tmp/gopath/pkg/mod/cache/vcs/6b28965f09cfe8e7b973d37ebfd08b08c6dc09351e669ad8906b51adcb50956a: exit status 128:
                fatal: could not read Username for 'https://github.com': terminal prompts disabled
        Confirm the import path was entered correctly.
        If this is a private repository, see https://golang.org/doc/faq#git_https for additional information.

这是 Go 拉取私有 GitHub module 时的经典问题

go env -w GOPRIVATE=github.com/minebiome/*
go env -w GONOSUMDB=github.com/minebiome/*
go env -w GOPROXY=https://goproxy.cn,direct

export GOPRIVATE=github.com/minebiome/*
export GONOSUMDB=github.com/minebiome/*

go clean -modcache
go mod tidy
{
        "Path": "github.com/cloudwego/eino-ext/components/model/qwen",
        "Version": "v0.1.5",
        "Query": "latest",
        "Time": "2026-01-20T09:07:14Z",
        "GoMod": "/ssd1/wy/go/pkg/mod/cache/download/github.com/cloudwego/eino-ext/components/model/qwen/@v/v0.1.5.mod",
        "GoVersion": "1.18"
}
module github.com/minebiome/news-go

require (
	// github.com/minebiome/ai-agent-go v0.0.0
	google.golang.org/grpc v1.74.2
	google.golang.org/protobuf v1.36.10
)

require (
	golang.org/x/net v0.51.0 // indirect
	golang.org/x/sys v0.41.0 // indirect
	golang.org/x/text v0.35.0 // indirect
	google.golang.org/genproto/googleapis/rpc v0.0.0-20250818200422-3122310a409c // indirect
)

// replace github.com/minebiome/ai-agent-go => ../ai-agent-go

go 1.25.6