![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
GoLang
zsr228
这个作者很懒,什么都没留下…
展开
-
Goland服务器代码同步
1、目的:在windows操作系统的goland上编程,项目文件随时同步到服务器上。在服务器上进行编译调试。2、过程:goland版本2020.1.3,服务器和本地均已有项目目录文件2.1 File->Settings->Plugins 搜索RemoteSynchron,然后install2.2 安装完成后Tools->Deployment->Configuration->SFTP 给这个远程连接取名2.3 SSH的配置,点击SSH configuration的三点原创 2020-07-25 16:06:46 · 1458 阅读 · 0 评论 -
golang使用xorm(odbc方式)操作达梦数据库
步骤:1、达梦客户端安装和ODBC数据源配置(略过),官网程序员手册pdf中有详细过程文档下载地址。2、https://github.com/go-xorm/xorm 需要用到的依赖包。名词解释(连接语句需要使用):数据库驱动名词(driver):DM8 ODBC DRIVER数据库名词(database):DM连接地址(server):127.0.0.1:5236用户名(uid)...原创 2019-11-21 17:22:16 · 3973 阅读 · 1 评论 -
Golang集成环境与HelloWorld
三种GoLang的集成环境,前提是安装好go环境 官方安装包和安装说明,傻瓜式点击next即可,windows环境go链接,安装完后cmd->go version有打印信息即成功 1.sublime+go 插件需要翻墙,如果爬不过去就别勉强自己,博主未成功 2.eclipse+go 安装eclipse for c/c++ developer,之后需要安装goeclipse,gocode,g原创 2017-04-14 16:58:25 · 1014 阅读 · 0 评论 -
Golang存取更新时间(time.Time)
首先表明问题,数据库中存的时间为datetime类型,golang中用time.Time1.存时间t := time.Now() //这里直接存t是没问题的fmt.Printf(t.Format("2006-01-02 15:04:05"))//这里格式化有个坑,必须是golang诞辰日,表示理解。记忆方式6123452.取时间正常取,json传过去,用str截取显示3.更新时间timeStr :原创 2017-06-16 16:09:00 · 4683 阅读 · 0 评论 -
golang struct match all field
应用场景:json.Unmarshal前检查结构体字段是否全匹配package mainimport ( "fmt" "encoding/json" "reflect")type A struct { X int Y string}type B struct { X int Y string Z string...原创 2018-06-26 21:01:16 · 193 阅读 · 0 评论 -
k8s container terminal proxy
k8s 容器终端参考如下链接https://github.com/kubernetes-ui/container-terminal为什么需要代理? 项目对k8s的api请求升级为https,导致对应的ws也升级为wss,需要项目另起一个proxy服务作为中间代理。解决思路:1、terminal->wss请求(web_socket1) 项目 api请求(web_s...原创 2018-06-28 17:08:25 · 1113 阅读 · 0 评论 -
singleton golang implement
单例模式:模拟打印机的使用场景import ( "sync" "fmt" "time")type Printer struct {}var ( Single Printer //打印机实例 once sync.Once //保证只执行一次方法 mutex sync.Mutex //锁对象)func init() ..原创 2018-07-19 11:24:01 · 226 阅读 · 0 评论