一见

#

[置顶] Linux后台开发工具箱-葵花宝典

摘要: 目录............................................................................................................................ 1 1. 前言................ 阅读全文

posted @ 2019-06-14 18:47 -见 阅读(3433) 评论(0) 推荐(1) 编辑

2024年4月4日 #

迁移Docker镜像存放目录

摘要: Docker镜像的默认目录为 /var/lib/docker 下的子目录 image,假设换到新的目录 /data1/docker,可按如下步骤操作: 1、停掉docker守护进程: systemctl stop docker 2、创建新的镜像存放目录: mkdir -p /data1/docker 阅读全文

posted @ 2024-04-04 17:12 -见 阅读(2) 评论(0) 推荐(0) 编辑

2024年3月27日 #

Windows的Linux子系统迁移

摘要: 默认 Windows 的 Linux 子系统(WSL)安装的 C 盘,如果有用作 Docker 镜像制作很容易磁盘不够用。可采取如下步骤迁移(以下在 Windows PowerShell 中进行的,但在 CMD.exe 中执行效果相同): 1、执行一下命令查看 Linux 子系统的发行版名称(dis 阅读全文

posted @ 2024-03-27 14:42 -见 阅读(5) 评论(0) 推荐(0) 编辑

2024年3月13日 #

goland设置保存文件时不将4个空格转为TAB

摘要: goland设置保存文件时不将4个空格转为TAB 版本:GoLand 2022.3 设置路径: Settings -> Editor -> Code Style -> Go -> Run gofmt 图示: 阅读全文

posted @ 2024-03-13 09:51 -见 阅读(4) 评论(0) 推荐(0) 编辑

2024年3月11日 #

go的descriptorpb.Default_FileOptions_PhpGenericServices的undefined问题

摘要: 在执行 go 编译是遇到如下问题: go\pkg\mod\github.com\golang\protobuf@v1.5.2\protoc-gen-go\descriptor\descriptor.pb.go:106:61: undefined: descriptorpb.Default_FileO 阅读全文

posted @ 2024-03-11 16:03 -见 阅读(129) 评论(0) 推荐(0) 编辑

2024年3月5日 #

git的"You can't push commits with committe"解决方法

摘要: 如果使用错误的用户和邮箱执行了git提交,在执行 git push 时将遇到如下错误: ! [remote rejected] feature_116390305_story_0 -> feature_116390305_story_0 (You can't push commits with co 阅读全文

posted @ 2024-03-05 23:00 -见 阅读(5) 评论(0) 推荐(0) 编辑

2024年3月3日 #

根据建表sql语句生成go的struct代码工具

摘要: sql2struct 一个根据"CREATE TABLE"建表语句生成对应的Go语言结构体的工具,暂只支持 MySQL 表。 开发目的 在 github 中找到一些 sql2struct,但要么是 chrome 插件,要么是在线工具,要么是需要连接 MySQL,不是很方便。本 sql2struct 阅读全文

posted @ 2024-03-03 16:40 -见 阅读(14) 评论(0) 推荐(0) 编辑

2024年3月1日 #

go写mysql取得自增字段值

摘要: 场景:有多张表,依据其中一张表的自增字段取得 id 值作为对象ID,然后使用这个Id插入到其他它表中。 如下一张 MySQL 的 innodb 表 X,用 go 编写程序,不指定 a 的值,指定 b 和 c 的值,往表 X 插入数据,如果数据已经存在则执行更新操作,成功后取得该笔插入或者更新的记录对 阅读全文

posted @ 2024-03-01 21:41 -见 阅读(7) 评论(0) 推荐(0) 编辑

2024年2月24日 #

配置项目的git

摘要: 只需要编辑项目根目录下的 .git/config 文件,其中 .git 为根目录下的子目录。当需要操作多个来源不同仓库的项目时,需要做这个设置,比如一个来自 github.com,一个来自私有仓库的。 % cat .git/config [core] repositoryformatversion 阅读全文

posted @ 2024-02-24 09:27 -见 阅读(3) 评论(0) 推荐(0) 编辑

2024年2月19日 #

grpc-go通过context传递额外数据

摘要: 使用 ctx.Value 从 context 读取数据 // ValueFromIncomingContext returns the metadata value corresponding to the metadata // key from the incoming metadata if 阅读全文

posted @ 2024-02-19 10:07 -见 阅读(12) 评论(0) 推荐(0) 编辑

2024年2月18日 #

go-zero/grpc的rpc服务间传递额外数据

摘要: 客户端: md := metadata.New(map[string]string{"signature": "0123456789", "timestamp": "2021-07-01 00:00:00"}) ctx := metadata.NewOutgoingContext(ctx, md) 阅读全文

posted @ 2024-02-18 23:04 -见 阅读(18) 评论(0) 推荐(0) 编辑

导航