goioc 介绍 goioc 是一个基于 GO 语言编写的依赖注入框架,基于反射进行编写。 支持泛型; 简单易用的 API; 简易版本的对象生命周期管理,作用域内对象具有生命; 延迟加载,在需要的时候才会实例化对象; 支持结构体字段注入,多层注入; 对象实例化线程安全,作用域内只会被执行一次。 [......] 继续阅读
goioc 介绍 goioc 是一个基于 GO 语言编写的依赖注入框架,基于反射进行编写。 支持泛型; 简单易用的 API; 简易版本的对象生命周期管理,作用域内对象具有生命; 延迟加载,在需要的时候才会实例化对象; 支持结构体字段注入,多层注入; 对象实例化线程安全,作用域内只会被执行一次。 [......] 继续阅读
Introduction to goioc goioc is a dependency injection framework written in Go language that is based on reflection. Supports generics; Simple and eas[......] 继续阅读
建立链路 SDK 官方仓库地址: https://github.com/open-telemetry/opentelemetry-go 设计一个这样的执行流程: Run 先后执行 Run1、Run2: a.Run1(newCtx) a.Run2(newCtx) Run1 中,还执行[......] 继续阅读
Establishing Link SDK Official Repository Address: https://github.com/open-telemetry/opentelemetry-go Design an execution flow like this: Run execute[......] 继续阅读
使用示例: package main import ( "fmt" "os" "os/signal" ) func main() { // Set up channel on which to send signal notifications. // W[......]继续阅读
package main import ( "fmt" "os" "os/signal" ) func main() { // Set up channel on which to send signal notificatio[......]继续阅读
使用 Go 中常用的 log 方法: Print/Printf/Println : 打印日志信息 Panic/Panicf/Panicln : 打印日志信息后,以拼装好的字符串为参数调用 Panic Fatal/Fatalf/Fatalln : 打印日志信息后,os.Exit(1) 退出程序 New[......] 继续阅读
Usage Common log methods in Go: Print/Printf/Println : Print log information Panic/Panicf/Panicln : Print log information and call Panic with the form[......]继续阅读
package main import ( "context" "fmt" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" "k8s.io/client-go/t[......]继续阅读
package main import ( "context" "fmt" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes&q[......]继续阅读
[TOC] 背景 其实,规划这篇文章有一段时间了,但是比较懒,所以一直拖着没写。 最近时总更新太快了,太卷了,所以借着 .NET 7 正式版发布,熬夜写完这篇文章,希望能够追上时总的一点距离。 本文主要介绍如何在 .NET 和 Go 语言中如何生成系统(Windows)动态链接库,又如何从代码中引用[......] 继续阅读
[TOC] Background Actually, I've been planning to write this article for a while, but I've been quite lazy, so I've kept delaying it. Recently, updates[......] 继续阅读
基础 Go Web 的表单类型有三种: r.Form r.PostForm r.MultipartForm PostForm 支持 form-data 和 x-www-form-urlencoded 两种请求体,但是不支持上传文件。 MultipartForm 只支持 for[......] 继续阅读
Basics There are three types of forms in Go Web: r.Form r.PostForm r.MultipartForm PostForm supports form-data and x-www-form-urlencoded request b[......] 继续阅读
scanme.nmap.org is the domain or IP address to be scanned. package main import ( "fmt" "net" "sort" ) func main() {[......]继续阅读
scanme.nmap.org 是要扫描的域名或 IP 地址。 package main import ( "fmt" "net" "sort" ) func main() { ports := make(chan int, 100) results :=[......]继续阅读
reflect.Type.Elem() 可以返回元素的类型,例如指针类型,返回不带指针的类型。 reflect.Value.Elem() 是获取指向值的引用。 type name struct { } func (n name) Print(str string) { } func main([......]继续阅读
reflect.Type.Elem() can return the type of the element, for example, for pointer types, it returns the type without the pointer. reflect.Value.Elem()[......] 继续阅读
In the context of Linux, here's how to invoke a command-line program in Go, with the example code as follows: package main import ( "log&quo[......]继续阅读
以 Linux 为例,在 Go 中调用一个命令行程序,其代码示例如下: package main import ( "log" "os" "os/exec" ) func main() { cmd := exec.Command("top") cmd.S[......]继续阅读