go mod init 模块名 //为项目指定模块名使其模块化(创建go.mod) 不要轻易手动删除 go.sum 文件。 如果需要更新依赖,应使用 go get -u 或 go mod tidy 等命令来操作。 可以执行 go mod tidy 或 go mod verify 命令来修复或更新 go.sum 文件 如果出现依赖问题,可执行:go clean -modcache 清除后再执行...
package main import ( "fmt" "github.com/lomtom/go-utils/job" ) func main(){ j := job.NewTimerJob(func(j job.TimerJob) { fmt.Println("这是一个定时任务") }, // 设置间隔时间(默认一分钟) job.SetDuration(time.Second)) err := j.Start() if err != nil { log.Println(err) ...
免费加入 已有帐号?立即登录 master 克隆/下载 git config --global user.name userName git config --global user.email userEmail 分支1 标签0 贡献代码 同步代码 茶馆主人增加zimg工具包3776a913年前 3 次提交 取消 提示:由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件 ...
go get -u github.com/jefferyjob/go-easy-utils 使用Go1.18以下版本的用户,必须安装v1.x.x。目前最新的v1版本是v1.1.0 go get github.com/jefferyjob/go-easy-utils@v1.1.0 使用Demo packagemainimport("fmt""github.com/jefferyjob/go-easy-utils/sliceUtil")funcmain(){varslice = []string{"this"...
import"github.com/Andrew-M-C/trpc-go-utils/plugin"// ...clientYamlConf:=struct{Keystring`yaml:"key"`}{} 然后,利用 Go 泛型的类型推测机制,开发者只需要将上面这个 struct 类型的地址作为 Bind 的参数即可: 代码语言:go AI代码解释 plugin
go-easy-utils 介绍 这是一个基于 Go 语言开发的通用数据类型处理工具类,帮助开发者在业务代码实现中处理常见的数据类型和数据操作。可以让您专注于您的业务代码的实现,而免去处理基本数据类型转换和验证的功能。该工具库无侵入式的设计可以让您的业务代码更容易阅读和优雅。
│ └── utils │ ├── converter.go │ └── converter_test.go └── internal ├── config │ ├── config.go │ └── config_test.go └── model ├── user.go └── user_test.go 在这个项目中,我们遵循以下几点: ...
用于IDAPro 的GoUtils,以及基于GoUtils 2.0开发的更强的IDAGolangHelper。 前文提到的Reversing GO binaries like a pro可能是业内最火的介绍 Go 二进制逆向的文章,但最火的工具可能还是IDAGolangHelper: IDAGolangHelper对 Go 的不同版本做了更精细化处理,而且第一次在 Go 二进制文件解析中引入moduledata这个...
go run main.go utils.go 输出结果: Hello from utils! 3 // greet.gopackage mainimport ( "fmt" "os")func main() { if len(os.Args) > 1 { fmt.Println("Hello, " + os.Args[1] + "!") } else { fmt.Println("Hello, Go!") }} ...
go get github.com/lomtom/go-utils 使用 以下是工具的简单使用,更多使用请点击标题查看详细介绍。 1.Map缓存 使用Map缓存工具,您可以轻松存储和检索键值对数据,加速数据访问。 packagemainimport("fmt""github.com/lomtom/go-utils/cache")funcmain(){c,err:=cache.NewMapCache[int]()iferr!=nil{fmt.Printl...