golang 根据开始日期和结束日期计算出时间段内所有日期 分24小时时段

发布时间:2021-09-10 10:31:03   分类:golang

// GetBetweenDates 根据开始日期和结束日期计算出时间段内所有日期 // 参数为日期格式,如:2020-01-01 func GetBetweenDates(sdate, edate string) []string {    d := []string{}    if sdate == edate {       d = append(d, 

golang 根据开始日期和结束日期计算出时间段内所有日期

发布时间:2021-09-10 10:29:41   分类:golang

// 参数为日期格式,如:2020-01-01 func GetBetweenDates(sdate, edate string) []string {    d := []string{}    if sdate == edate {       d = append(d, sdate)       return&n

Nginx 上传大文件报跨域错误

发布时间:2021-07-09 11:55:39   分类:liunx & centos&nginx

NGINX 上传大文件报跨域   原因 是上传大文件接超时导致NGINX修改超时配置http{ #读取http头部的超时时间,单位秒,连接建立后,服务端接收http头部,规定时间内没收到,则超时,返回给客服端408(request time out) client_header_timeout 60; #读取http body的超时时间,单位秒,连接建立后,服务端接收body,规定时间内没收到,则超时,返回给客服端408(request time out) client_body_timeout 60; #发送响应超时时间,单位秒,服务端向客户端发送数据包,规定时间内客户端没收到,则超时 send_timeout 60; #保持闲置

Windows下升级golang版本

发布时间:2021-06-28 17:17:37   分类:golang

下载需要升级的版本https://golang.google.cn/dl/ 安装按照旧版本的同样目录安装,这样环境变量配置无需修改查看安装目录go env  GOROOT=D:\go   目录  GOVERSION=go1.16.5   版本

mysql 常见错误之: SQL Error: 1366: Incorrect string value: \xE8\xAF\xA6\xE7\xBB\x86: for column

发布时间:2021-06-28 15:57:50   分类:MySQL

当遇到无法往数据库插入中文的时候,常常伴随出现SQL Error: 1366: Incorrect string value: \xE8\xAF\xA6\xE7\xBB\x86: for column这类的错误报告一般是字符串编码问题,建议修改为utf-8

在golang中将Json.Number转换(interface conversion: interface {} is json.Number)

发布时间:2021-06-07 16:34:41   分类:golang

//go 出现json.Number类型转换错误处理panic: interface conversion: interface {} is json.Number, not float64//.int .int64f, err := data.(json.Number).Float64()

Go invalid memory address or nil pointer dereference错误

发布时间:2021-04-28 09:54:46   分类:golang

在使用GO指针的时候,出现 panic: runtime error: invalid memory address or nil pointer dereference,这其实是典型的Go 指针声明后没有对指针先初始化而直接赋值导致的错误。0xc00009a008 <nil> panic: runtime error: invalid memory address or nil pointer dereference[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1092f9c]错误示例及原因解释package main func main(

nginx vue 前端POST请求405问题解决

发布时间:2021-04-25 15:33:21   分类:liunx & centos&nginx

前端vue NGINX代理,访问go接口405,查看Vue代理的地址和NGINX的转发地址是否嫩对应上: {     [..]: { : : : { [+ ..]: }     } }location /api/ {   proxy_set_header X-Forwarded-Proto $scheme;   proxy_set_header X-Forwarded-Port 

运行docker alpine 容器时报standard_init_linux.go:211: exec user process caused "no such file or directory"

发布时间:2021-04-25 15:28:52   分类:docker

解决步骤1: 安装dos2unix RUN  apk add --update --no-cache  dos2unix解决步骤2: 将相关文件转换一下字符dos2unix aa.sh  //run-lamp.sh 是执行问题根据自己修改

linux 修改用户密码的几种方法

发布时间:2021-04-20 10:01:54   分类:liunx & centos&nginx

1、passwd 命令,手动修改:[root@localhost testuser]# passwd testuser Changing password for user testuser. New password:  Retype new password:  passwd: all authentication tokens updated successfully. [root@localhost testuser]# 2、passwd 命令,命