随笔分类 -  GoLang基础

摘要:![](https://img2022.cnblogs.com/blog/1441611/202203/1441611-20220316092159830-697603576.png) 阅读全文
posted @ 2022-03-16 09:22 HaimaBlog 阅读(296) 评论(0) 推荐(0)
摘要:微服务从代码到k8s部署应有尽有系列全集 https://mp.weixin.qq.com/s/8U2h85YJHy3H3hzlBakPPw 实战项目地址:https://github.com/Mikaelemmmm/go-zero-looklook 阅读全文
posted @ 2022-03-06 14:32 HaimaBlog 阅读(162) 评论(0) 推荐(0)
摘要:ruby和glang的md5和sha1加密对比 package main import ( "crypto/md5" "crypto/sha1" "fmt" "io" "io/ioutil" "log" "strings" ) func main() { testMd5OrSha2() } func 阅读全文
posted @ 2022-03-04 15:02 HaimaBlog 阅读(158) 评论(0) 推荐(0)
摘要:1.下载编译好的包 https://sourceforge.net/projects/mingw-w64/files/mingw-w64/ 这里我选择64位的 2.解压完之后,配置环境变量。 解压完到 D:\Program Files (x86)\mingw64 3.将安装路径对应的bin目录添加到 阅读全文
posted @ 2022-02-25 13:14 HaimaBlog 阅读(1292) 评论(0) 推荐(0)
摘要:文档地址: https://xuri.me/excelize/zh-hans/ package main import ( "fmt" "github.com/xuri/excelize/v2" ) func main() { readEecel() //writeEecel() //appendE 阅读全文
posted @ 2022-02-19 17:10 HaimaBlog 阅读(2307) 评论(0) 推荐(0)
摘要:官网手册: https://go-zero.dev/cn/ 文档说明: https://zhuanlan.zhihu.com/p/461604538 本地开发运行环境: https://github.com/nivin-studio/gonivinck 代码地址: https://github.co 阅读全文
posted @ 2022-02-12 09:42 HaimaBlog 阅读(315) 评论(0) 推荐(0)
摘要:本文主要在于带着大家完成一个基本的 CRUD 工作,让大家熟悉 Fiber + MongoDB 构建 RESTful API,熟悉工作流程。同时了解相关库的使用。 本文的完整代码见:https://github.com/programmerug/fibermongo。 文档说明: https://m 阅读全文
posted @ 2022-02-11 09:23 HaimaBlog 阅读(303) 评论(0) 推荐(0)
摘要:目录编写roles.proto 描述文件生成服务代码api和rpc服务连接的方式搭建 ETCD 环境 参考文档: https://go-zero.dev/docs/tutorials/proto/spec 视频地址: https://space.bilibili.com/387126464/chan 阅读全文
posted @ 2022-02-02 17:03 HaimaBlog 阅读(466) 评论(0) 推荐(0)
摘要:官方文档: https://go-zero.dev/cn/docs/introduction 视频地址: https://space.bilibili.com/387126464/channel/series 系统环境: linux debain 配置环境: 1. golang安装 配置go环境变量 阅读全文
posted @ 2022-02-01 21:56 HaimaBlog 阅读(2240) 评论(0) 推荐(0)
摘要:面试题连接 https://studygolang.com/articles/17796 go变量哪些是引用类型,哪些是值类型 指针:slice,map,chan,指针,interface 值类型:int,float,bool,string,array,struct golang中new和make的 阅读全文
posted @ 2021-11-23 07:20 HaimaBlog 阅读(296) 评论(0) 推荐(0)
摘要:一、概述 官方的math 包中提供了取整的方法,向上取整math.Ceil() ,向下取整math.Floor() 二、用法 package main import ( "fmt" "math" ) func main(){ x := 1.1 fmt.Println(math.Ceil(x)) // 阅读全文
posted @ 2021-10-06 20:40 HaimaBlog 阅读(4787) 评论(0) 推荐(0)
摘要:GoTests工具自动化test使用 1.插件包地址: https://github.com/cweill/gotests 安装 go get -u github.com/cweill/gotests/... 会在go.mod里引入插件包 2.为选择的方法创建单元测试方法 3.测试单个函数方法 3. 阅读全文
posted @ 2021-10-06 18:37 HaimaBlog 阅读(289) 评论(0) 推荐(0)
摘要:[TOC] ## 参考文档 xpath helper https://www.cnblogs.com/ChevisZhang/p/12869582.html http://c.biancheng.net/python_spider/xpath-helper.html XPath Helper使用教程 阅读全文
posted @ 2021-09-30 15:03 HaimaBlog 阅读(264) 评论(0) 推荐(0)
摘要:学习视频: https://www.bilibili.com/video/BV1Sg411T7TV?p=69 学习资料下载: 链接: https://pan.baidu.com/s/1Yk4GemFRmZ9s44fTYABIwA 密码: ns6e 阅读全文
posted @ 2021-09-25 14:48 HaimaBlog 阅读(105) 评论(0) 推荐(0)
摘要:例子一: golang 数组分割 需求:给定一个数组和一个正整数,要求把数组分割成多个正整数大小的数组,如果不够分,则最后一个数组分到剩余的所有元素。 package main import ( "fmt" ) func main() { //demo01() //demo02() demo03() 阅读全文
posted @ 2021-08-12 07:26 HaimaBlog 阅读(9144) 评论(0) 推荐(0)
摘要:csv读写 封装成工具包 package utils import ( "encoding/csv" "fmt" "log" "os" "path" "time" ) func ReadCsv(filePath string) (data [][]string, err error) { f, er 阅读全文
posted @ 2021-06-29 15:16 HaimaBlog 阅读(1415) 评论(0) 推荐(0)
摘要:gorm 关系一对一,一对多,多对多查询 gorm v2版本 Belongs To mysql表 CREATE TABLE `user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(64) NOT NULL DEFAULT '', ` 阅读全文
posted @ 2021-06-12 22:53 HaimaBlog 阅读(4308) 评论(0) 推荐(0)
摘要:https://github.com/haimait/go-devise-encryptor package main import ( "fmt" //devisecrypto "haimait/learn/testdevise/go-devise-encryptor" "github.com/c 阅读全文
posted @ 2021-05-06 16:22 HaimaBlog 阅读(97) 评论(0) 推荐(0)
摘要:一.思路: 把go-admin-ui包成静态html文件,放在go-admin的静态目录static里加载服务 这样前后台启一个服务就可以了 下面开始操作 二.打包go-admin-ui为静态文件 a.修改配置文件 修改文件.env.production 这里是请求api的接口地址的配置 # jus 阅读全文
posted @ 2021-04-10 11:23 HaimaBlog 阅读(745) 评论(0) 推荐(0)
摘要:搜索条件参考下面的文件 https://github.com/go-admin-team/go-admin-core/blob/master/tools/search/query_test.go type ApplicationQuery struct { Id string `search:"ty 阅读全文
posted @ 2021-04-09 16:36 HaimaBlog 阅读(522) 评论(0) 推荐(0)