500 个英文高频单词拿下 Go 语言文档

500 个英文高频单词拿下 Go 语言文档
Photo by Glen Carrie / Unsplash

一、Go 语言 300 个英文高频单词

Category 类别 高频词
Basic Concepts 基本概念 Go, Golang, Gopher, Compiler, Run, Package, Module, Standard Library, Project, Executable, Command-line, Toolchain, Environment Variable, Dependency, GOPATH, GOROOT, Go Module, Go Proxy, Go Version, Build, go fmt
Data Types 数据类型 int, float, bool, string, array, slice, map, struct, interface, pointer, type alias, interface{}, type assertion, type conversion
Control Structures 流程控制 if, for, break, continue, switch, return, defer, panic, recover
Functions & Methods 函数&方法 function, method, parameter, return value, function signature, variadic parameter, closure, anonymous function, higher-order function
Concurrency 并发 Goroutine, channel, synchronization, mutex, RWMutex, select, WaitGroup, lock-free programming, timer, scheduler
Error Handling 错误处理 error, exception, error handling, custom error, panic/recover
Interfaces & Reflection 接口与反射 interface, type assertion, type matching, reflection, type interface, implementation
Concurrency & Performance 并发与性能 concurrency, parallelism, performance, memory allocation, GC (garbage collection), memory leak, memory pool
I/O Operations I/O 操作 file, open, close, read, write, file path, buffer, io.Reader, io.Writer, ioutil, os, directory, permissions, seek, truncate
Testing 测试 test, testing, unit test, benchmark, mock, assertion, test case, coverage, test framework, failure, success, assertion error
Networking 网络 HTTP, TCP, UDP, client, server, request, response, socket, connection, protocol, URL, headers, port, server-side, client-side
Data Structures 数据结构 linked list, tree, graph, queue, stack, heap, set, binary tree, AVL tree, hash table, hash map, priority queue
Algorithms 算法 sorting, searching, merge, quicksort, binary search, Dijkstra, BFS (breadth-first search), DFS (depth-first search), dynamic programming
Database 数据库 database, SQL, NoSQL, query, table, column, row, insert, update, delete, transaction, connection, index, join, schema, migration, database driver, ORM
Version Control 版本控制 Git, branch, commit, pull request, merge, clone, fork, push, pull, tag, rebase, clone, checkout, remote, local repository
Package Management 包管理 dependency management, Go module, versioning, go get, go mod, vendor, package registry, repository, Go proxy
Debugging debug debug, breakpoint, stack trace, logging, profiler, memory leak, CPU profiling, error stack, crash, runtime
Security 安全 encryption, decryption, TLS, SSL, certificate, hash, bcrypt, key management, HMAC, CSRF, XSS, injection
Performance Optimization 性能优化 caching, optimization, load balancing, profiling, latency, throughput, rate limiting, throttle, system tuning
Deployment 部署 Docker, Kubernetes, container, cloud, CI/CD, deployment pipeline, orchestrator, configuration, scaling, load balancing
Frameworks & Libraries 框架和库 Gin, Echo, Beego, gRPC, SQLx, MongoDB, Redis, Prometheus, Grafana, Logrus, Zap, Cobra, Viper
Go Tools Go 工具 go build, go run, go test, go fmt, go get, go doc, go install, go clean, go mod, go generate
Miscellaneous 杂项 concurrency model, stack, heap, algorithmic complexity, pointer arithmetic, garbage collector, channel buffer, mutex lock, context, deadline, timeout

二、命名相关

变量命名相关的高频词汇

Category 类别 高频词
type 数据类型 value, count, index, length, size, key, item, data, result, flag, status, config, option, path, name, id, number, string, message, code, type, element
Status 状态 state, status, active, inactive, enabled, disabled, current, previous, initialized, updated, new, old, error, success, complete, done, ready, finished
collection 集合类型 list, array, slice, map, set, queue, stack, queue, element, node, item, value, result, itemList, dataSet
date time 时间和日期 timestamp, time, date, deadline, interval, duration, start, end, timeout, retry, wait, epoch
sign 标识符 user, admin, customer, session, account, token, key, permission, role, group, request, response
count & index 计数和索引 counter, total, count, sum, index, position, loopIndex, iteration, offset
file & path 文件和路径 file, directory, path, filename, extension, content, reader, writer
networking 网络 url, address, port, ip, host, connection, request, response, header, body, method
error & status 错误与状态 error, err, exception, failure, warning, message, result, output, success, status
configuration 配置 config, settings, option, parameters, defaults, flags, environment
amount 数值/金额 price, amount, quantity, total, value, cost, discount, tax, fee
security 安全性 token, salt, hash, key, password, credentials, encryption, decryption
user 用户 user, admin, profile, username, password, email, session, auth, role, permission
cache & storage 缓存和存储 cache, storage, memory, database, table, row, column, cacheData, storedValue
function |action 函数或动作 handler, processor, updater, creator, generator, validator, reader, writer, manager, retriever, setter, getter, updater, controller

函数命名相关的高频词汇

Category 类别 高频词
normal action 常见动作 get, set, create, update, delete, fetch, retrieve, save, load, process, handle, validate, check, compare, convert, build, transform, parse, format, apply
return & result 返回类型/结果 is, has, can, should, find, calculate, compute, verify, test, handle, generate, ensure
status & result 状态/结果 success, failure, done, complete, ready, init, shutdown, exit, retry, stop, start
collection action 集合/列表操作 add, remove, append, pop, push, insert, iterate, iterateOver, clear, reset, sort, merge
condition & filter 条件与过滤 filter, match, validate, compare, check, determine, test, evaluate, exists, contains
async / concurrency 异步/并发 execute, run, async, await, start, finish, cancel, wait, signal, notify, timeout
error handling 错误处理 handleError, catchError, throwError, fail, panic, recover, report, logError
data convert 数据转换 map, convert, serialize, deserialize, encode, decode, stringify, parse
timing 计时与延迟 delay, timeout, wait, sleep, elapsed, schedule, tick, waitFor
context 上下文 with, bind, attach, context, setup, close, open, begin, end
resource management 资源管理 open, close, release, acquire, reserve, free, destroy, reset
networking 网络操作 connect, disconnect, send, receive, transmit, ping, checkConnection, sendRequest, getResponse
Accessibility 辅助功能 init, setup, teardown, validate, verify, normalize, sanitize, sanitizeInput, cleanup, reset

Read more

golang proto api 校验国际化 protovalidate

golang proto api 校验国际化 protovalidate

众所周知,protobuf 原型文件扩展很多功能,比如生成 http 接口层代码,顺势就有了生成接口参数校验代码的需求。 早期可以使用https://github.com/bufbuild/protoc-gen-validate 来实现,通过生成特定的 go 代码的方式来实现校验。 github 中也提到目前趋于稳定,不会有更多新特性的支持,推荐大家使用新的版本 protovalidate,https://github.com/bufbuild/protovalidate 。该版本是protoc-gen-validate 的“精神继承者”。它不需要任何代码生成并支持自定义约束。 现在我们尝试新版本,并且增加国际化支持。 go get github.com/bufbuild/protovalidate-go import "github.com/bufbuild/protovalidate-go" syntax = "proto3"; package

By brian
git clone 复制一个整个仓库并推送到新地址

git clone 复制一个整个仓库并推送到新地址

要使用 git clone --bare 复制一个新的仓库并推送到远程仓库,可以按照以下步骤操作: 1. 克隆一个裸仓库 首先,使用 git clone --bare 命令克隆源仓库。假设源仓库的 URL 是 https://github.com/user/source-repo.git,你可以执行以下命令: bash复制 git clone --bare https://github.com/user/source-repo.git 这将创建一个新的裸仓库(没有工作区),通常会创建一个名为 source-repo.git 的目录。 2. 进入裸仓库目录 进入刚刚克隆的裸仓库目录: bash复制 cd source-repo.git 3. 添加新的远程仓库 接下来,

By brian
搜索引擎技巧不用多,学会 3 个加速 100% 找到目标

搜索引擎技巧不用多,学会 3 个加速 100% 找到目标

在搜索时使用英文关键词,提高结果质量。尽量使用 google.com 以下搜索引擎技巧在 google.com 进行测试,效果都很好,前三个非常常用且强烈推荐。 使用精确搜索 * 建议: 使用双引号 "" 搜索完全匹配的短语,避免无关结果。 * 示例: * "Java NullPointerException" fix * 场景: 找到错误信息的精确解决方案。 利用站内搜索 * 建议: 使用 site: 限制搜索范围到特定网站。 * 示例: * site:stackoverflow.com "TypeError: undefined is not a function" * 场景: 搜索 Stack Overflow、官方文档或技术博客的特定内容。 一些关键词 * 建议:

By brian
沪ICP备2022013452号-1