Advanced Search
Search Results
9 total results found
Wire
Automated Initialization in Go. https://github.com/google/wire
Architecture
Web ├── cmd/ │ └── main.go ├── internal/ │ ├── controller/ │ │ └── user_controller.go │ ├── service/ │ │ └── user_service.go │ ├── repository/ │ │ └── user_repository.go │ └── model/ │ └── user.go ├── pkg/ │ └── common/ └── confi...
omitempty
默认行为 在使用 protoc 3 时,默认会为所有标量字段(包括字符串)添加 omitempty 标签。这是 protobuf 3 的一个默认行为。要解决这个问题,有几种方式: gogoproto 例子1 Inputmessage Config { int64 id = 1; string name = 2 [(gogoproto.jsontag) = "name"]; string desc = 3 [(gogoproto.jsontag) = "desc"]; Role role = 5 ...
Batch Send With Timeout
idleDuration := 10 * time.Second idleDelay := time.NewTimer(idleDuration) for { idleDelay.Reset(idleDuration) msgQueue := make([]model.MinIOEvent, 0, BatchSize) var needToSend bool for !needToSend { select { case msg := <-k.ms...
GORM Update
会忽略零值字段(默认值) type User struct { Name string Age int } db.Model(&user).Updates(User{Name: "Tom", Age: 0}) 这条语句中,Age: 0 会被忽略,因为 GORM 默认只更新非零值字段。 Solutions Model.Update(column, value) db.Model(&user).Update("age", 0) // 会把 age 更新为 0 使用 Map db.Model(&user...
Quick Start
Installation https://getcomposer.org/download/ php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php -r "if (hash_file('sha384', 'composer-setup.php') === 'dac665fdc30fdd8ec78b38b9800061b4150413ff2e3b6f88543c636f7cd84f6db9189d43a81e55...
Benchmark
ENV Ubuntu 22.04 2C2G/4C8G Response {"code":0,"message":"\u83b7\u53d6\u6210\u529f","data":{"total":10,"list":[{"id":1,"name":"\u6d4b\u8bd5\u7528\u62371","email":"test1@example.com","isVerified":true,"verifiedAt":"2025-04-08T09:22:52.000000Z","createdAt":"2...
Quick Start
Installation composer global require laravel/installer Errors Change Source. composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ New Project laravel new example-app php artisan migrate
Virtual Environment
pyenv Installation brewn install pyenv echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc echo 'eval "$(pyenv init - zsh)"' >> ~/.zshrc Usage List versions pyenv insta...