原创 go 語言學習筆記

Ubuntu go語言的安裝卸載 https://blog.csdn.net/Rcvisual/article/details/82755488   /usr/local/go/src/github.com/tidwall/redcon

原创 mysql utf8mb4 主鍵不能太長

[2020-06-03 17:44:21]  Error 1071: Specified key was too long; max key length is 767 bytes  2020/06/03 17:44:21 create

原创 redis集羣帶密碼驗證的hiredis客戶端

之前一直都是使用單機部署的redis服務器,用着hiredis不亦樂乎,後來公司改爲redis集羣,突然發現之前的hiredis不能用了,趕緊查了一下資料,終於發現了hiredis也有Cluster模式,剛開始找到的是hiredis-vi

原创 go mogodb查詢_id和根據_id查詢記錄

package main   import ( "context" "fmt" "log" "go.mongodb.org/mongo-driver/bson/primitive" "go.mongodb.o

原创 gorm mysql支持表情插入

mysql數據庫字段支持表情的插入方法: mysql數據庫要使用 utf8mb4 / utf8mb4-general-ci,同時gorm連接的時候字符集也要改爲 uft8mb4 ( charset=utf8mb4 )   https:/

原创 LiteIDE不能跳轉的解決辦法

刪除 C:\Users\Administrator\go\pkg\mod\github.com 的所有文件

原创 gin讀取了body數據後,再次獲取就爲空 的解決方法

需求: 記錄所有請求的json數據 body, _ := ioutil.ReadAll(c.Request.Body) if body != nil { log.Info("請求b

原创 go 語言學習

Ubuntu go語言的安裝卸載 https://blog.csdn.net/Rcvisual/article/details/82755488   /usr/local/go/src/github.com/tidwall/redcon

原创 求解答:結構體反序列化問題

#include <stdio.h> #include <stdlib.h> #include <string.h> #include <termios.h> #include <sys/socket.h> #include <strin

原创 limysqlclient編譯靜態庫及使用

一、從git上下載源碼 https://github.com/betabot7/mysql-connector-c 二、 mkdir build  cmake .. 三、 編譯完成,copy build/libmysql/libmysql

原创 文件日誌自動刪除備份

//log打印日誌,可以保存到文件中,當日志文件大於5M,自動備份到DebugLog2.log中,DebugLog1.log繼續存放最新的日誌,這樣就保證5M以上的最新日誌   #include <net

原创 C語言版本socket server

#include <stdio.h>   #include <string.h>   #include <stdlib.h>   #include <sys/types.h>    #include <s

原创 簡單的通用Makefile模板

DIR_INC = ./include DIR_SRC = ./src CC = gcc CFLAGS = -g -Wall -I${DIR_INC} LDFLAGS=-lpthread -lm   SR

原创 打印函數帶時間戳,可以屏幕和文件打印

#define DEBUG_TYPE_FILE 0 typedef enum TYPE_LOG_LEVEL {G_LOG_LEVEL_DEBUG = 0,G_LEVEL_INFO,G_LOG_LEVEL_

原创 利用libqrencode將二維碼信息保存到bmp圖片中

#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/types.h> #include <sys/stat.h