上一页 1 2 3 4 5 6 7 ··· 21 下一页
摘要: # window.localStorage.setItem 和 localStorage.setItem 有什么区别 - 在JavaScript中,localStorage.setItem和window.localStorage.setItem实际上是相同的, - 它们是对浏览器的本地存储(Loca 阅读全文
posted @ 2023-07-14 11:07 寻月隐君 阅读(210) 评论(0) 推荐(0) 编辑
摘要: del 和 pop 都可以从 Python 字典中删除一个键值对,不同之处在于它们的返回值和错误处理方式。 del 语句可以直接删除字典中的一个键值对,语法如下: `del dict[key]` del 语句没有返回值,如果尝试删除不存在的键,会抛出 KeyError 异常。 pop 方法可以删除字 阅读全文
posted @ 2023-06-26 10:36 寻月隐君 阅读(288) 评论(0) 推荐(0) 编辑
摘要: # Rust语言 - 接口设计的建议之受约束(Constrained) - [Rust API 指南 GitHub](https://github.com/rust-lang/api-guidelines):https://github.com/rust-lang/api-guidelines - 阅读全文
posted @ 2023-06-21 09:53 寻月隐君 阅读(102) 评论(0) 推荐(0) 编辑
摘要: # Rust语言 - 接口设计的建议之显而易见(Obvious) - [Rust API 指南 GitHub](https://github.com/rust-lang/api-guidelines): - [Rust API 指南 中文](https://rust-chinese-translat 阅读全文
posted @ 2023-06-19 18:36 寻月隐君 阅读(78) 评论(0) 推荐(0) 编辑
摘要: # Go 语言之 Shutdown 关机和fvbock/endless 重启 Shutdown 源码 ```go // Shutdown gracefully shuts down the server without interrupting any // active connections. 阅读全文
posted @ 2023-06-18 19:28 寻月隐君 阅读(187) 评论(0) 推荐(0) 编辑
摘要: # Go 语言之 Viper 的使用 ## Viper 介绍 [Viper](https://github.com/spf13/viper): ### 安装 ```bash go get github.com/spf13/viper ``` ### Viper 是什么? Viper 是一个针对 Go 阅读全文
posted @ 2023-06-18 15:29 寻月隐君 阅读(492) 评论(0) 推荐(0) 编辑
摘要: # Go 语言之在 gin 框架中使用 zap 日志库 ### gin 框架默认使用的是自带的日志 #### `gin.Default()`的源码 Logger(), Recovery() ```go func Default() *Engine { debugPrintWARNINGDefault 阅读全文
posted @ 2023-06-17 18:11 寻月隐君 阅读(585) 评论(0) 推荐(0) 编辑
摘要: # Go 语言之自定义 zap 日志 [zap 日志](https://github.com/uber-go/zap):https://github.com/uber-go/zap ## 一、日志写入文件 - `zap.NewProduction`、`zap.NewDevelopment` 是预设配 阅读全文
posted @ 2023-06-17 14:25 寻月隐君 阅读(311) 评论(0) 推荐(0) 编辑
摘要: # Go 语言之 zap 日志库简单使用 ## 默认的 Go log log:https://pkg.go.dev/log ```go package main import ( "log" "os" ) func init() { log.SetPrefix("LOG: ") // 设置前缀 f, 阅读全文
posted @ 2023-06-17 10:57 寻月隐君 阅读(131) 评论(0) 推荐(0) 编辑
摘要: # Go Redis 管道和事务之 go-redis ## [Go Redis 管道和事务官方文档介绍](https://redis.uptrace.dev/zh/guide/go-redis-pipelines.html) Redis pipelines(管道) 允许一次性发送多个命令来提高性能, 阅读全文
posted @ 2023-06-16 18:09 寻月隐君 阅读(443) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 21 下一页