3yfist 梦虽遥,追则能达;愿虽艰,持则可圆 ✊✊✊

gocv的yolo-detection代码分析

https://github.com/hybridgroup/gocv/tree/release/cmd/yolo-detection 文件分析及关键函数注释 文件概述 该文件实现了使用YOLOv8深度神经网络进行对象检测的功能。它从指定的视频源(摄像头或视频文件)读取帧,并使用预训练的YOLOv8

chiachan Published on 2025-02-07

对kratos服务进行颜色标签过滤

解决如何对kratos服务进行颜色标签过滤 应用场景 生产环境下新功能测试 带标签状态的需求 对来源用户进行分类服务划分 给服务打上color标签 在main.go中,metadata加入color标签即可,可以参考一下方式。从启动命令中读取 ... func init() { flag.Stri

chiachan Published on 2025-01-09

谜题排查:concurrent map read and map write报错

问题 今天收到同事发来的报错concurrent map read and map write 报错位置源码如下: var data = make(map[string]int64, 100) func GetValue(name string) int64 { return data[name

chiachan Published on 2025-01-09

go语言的Mutex和RWMutex

golang 中的 sync 包实现了两种锁: Mutex:互斥锁 RWMutex:读写锁,RWMutex 基于 Mutex 实现 Mutex(互斥锁) Mutex 为互斥锁,Lock() 加锁,Unlock() 解锁 在一个 goroutine 获得 Mutex 后,其他 goroutine 只能

chiachan Published on 2025-01-09

vscode golang环境

安装githistory和gitLens插件;安装go插件

chiachan Published on 2024-12-30

搭建go环境

推荐使用go版本管理工具 https://github.com/moovweb/gvm

chiachan Published on 2023-11-21

跨操作系统编译

在Mac、Linux、 Windows平台下,编译其他平台的可执行程序

chiachan Published on 2023-11-21

go语言优雅打印json、struct结构

优雅打印json、struct结构

chiachan Published on 2022-03-21

Visitor模式(访问者模式)

什么是访问者模式? 访问者模式即访问数据结构并处理数据 示范代码(visitor.go) 元素接受不同访问者访问 package Visitor import "fmt" // 访问者 type Visitor interface { visit() } type UserVisitor s

chiachan Published on 2020-08-30

Decorator模式(装饰器模式)

什么是装饰者模式? 装饰者模式即保持装饰者和被装饰者的一致性 可以不断地为对象添加装饰 主要目的就是通过添加装饰物来增加类的功能 示范代码(decorator.go) 计算函数运行时间 package Decorator import ( "log" "math" "time" ) typ

chiachan Published on 2020-08-30
Previous Next