随笔分类 - Gin
摘要:C:\Program Files\Go\src\crypto\tls\generate_cert.go 找到这个文件,windows下直接运行应该有问题。 复制全部代码到main.go 然后右键执行 复制文件到gin项目中 结果:
阅读全文
摘要:记一下: 本地显示是这样的: 但是使用网站检测工具: 而且让同学从外地访问,证明也没问题,我本地防火墙关闭也不行。 猜测还是本地环境问题,准备换成https.
阅读全文
摘要:FROM docker.io/golang:1.15.14 as builder COPY . / WORKDIR /Initial ENV GO111MODULE=on \ GOPROXY=https://goproxy.cn,direct RUN CGO_ENABLED=0 GOOS=linux
阅读全文
摘要:每次从vue发过来的时间到gin这里就少了八个小时。似乎没有像Django那样的全局配置。 暂时对时间进行转换。 issue package main import ( "fmt" "github.com/golang-module/carbon" ) func main() { a:= carbo
阅读全文
摘要:model 定义 type Plan struct { Id int `gorm:"primary_key"` Title string `gorm:"column:title;not null;size:128"` Start time.Time `gorm:"type:date;column:s
阅读全文
摘要:github.com/gin-gonic/gin v1.7.2关于validator // Validator is the default validator which implements the StructValidator // interface. It uses https://gi
阅读全文
摘要:绑定参数到结构体的问题:
阅读全文
摘要:本来想用gin_scaffold这个写web,但是这个框架作者用了自己封装的golang_common来初始化数据库,以及引用了自己的Gorm,所以打算参考作者的项目结构,用原生的Gorm写, 简单实现的两个接口: controller: package controller import ( "I
阅读全文
摘要:源码地址:https://github.com/e421083458/gin_scaffold 提前配置好go mod(好用的GO包管理工具,本地需要的第三方包和别的本地目录都可以自动导入) git clone git@github.com:e421083458/gin_scaffold.git c
阅读全文

浙公网安备 33010602011771号