logo
publist
写文章

简介

该用户还未填写简介

擅长的技术栈

可提供的服务

暂无可提供的服务

golang gorm 搜索sql组装

gorm例子func (r *repo) List(offset, pageSize int, filter *do.Filter) (total int, list []do.UserDo, err error) {rows := make([]models.User, 0)params := make([]interface{}, 0)condition := " u.state = ? an

#sql#golang
vue-cli 无法安装问题解决

在macOS上安装vue-cli,但一直都失败,最后终于解决。先后报错了2个问题。

文章图片
#vue.js#前端#javascript
golang gorm 更新零值字段的方法

坑使用golang的gorm更新0值的字段,总是失败。按照官方文档,如果字段值中有0值,不能再使用 struct,而需要使用 map[string]interface{},但实际上还是失败,比对了很久,才发现是在Updates方法不能传入map的指针,必须是map的值。错误的写法values := map[string]interface{}{"status":0,"from": hash,}er

composer 报错 Could not find a matching version of package bower-asset/jquery

报错内容composer require bower-asset/jquery 报错如下Could not find a matching version of package bower-asset/jquery解决办法修改 composer.json,加入如下配置,指定地址"repositories": [{"type": "composer","url": "https://asset-pa

#php#composer
ajax JSONP请求 处理回调函数的注意:jsonpCallback是区分大小写

使用ajax进行 JSONP跨域请求,因为被请求的对方的回调函数是无法修改。对方返回的JS都固定了回调函数名称_Callback。而这边页面中会出现多个JSONP请求,他们的回调函数名称都是_Callback,想到设置AJAX 的JSONP参数。但是发现根本不起作用。最后偶然发现 jsonpcallback是区分大小写的。必须是  jsonpCallback 而不是jsonpcallback

python 引入上层目录 ValueError: attempted relative import beyond top-level package

运行报错进入单独的目录,运行有引入上一层的脚本的,报错ValueError: attempted relative import beyond top-level package# utils.py# test/crawl.py# cd test# python3.6 crawl.py# 报错ValueError: attempted relative import bey...

#python
git push remote unpack failed: error Missing tree

解决办法参数 --no-thin,加入这个参数。git push origin head:refs/for/master --no-thinOK

#git
解决mac执行 go run main.go 弹出防火墙警告

问题mac下面执行 go run main.go 总是弹出防火墙警告。原因及解决[GIN-debug] Listening and serving HTTP on :8080[GIN-debug] Listening and serving HTTP on 127.0.0.1:8080启动的时候不要只写端口,而是把本地IP也写进去,就不会弹出这个警告...

文章图片
#golang#mariadb
nginx 屏蔽采集的 $http_user_agent

block_cralwer# save at /etc/nginx/block_cralwer# then use it `include block_cralwer` at `server` directiveset $fbd 0;if ($http_user_agent ~* "yandex|Ahref|MJ12bot|XoviBot|SemrushBot|AhrefsBot|T..

#nginx#centos
centos -bash: fork: Resource temporarily unavailable 解决办法

报错信息进程调用 php 执行提示如下:-bash: fork: Resource temporarily unavailable解决办法修改配置 /etc/security/limits.d/90-nproc.conf 增加 www 用户的进程最大限制[www@vps root]$ cat /etc/security/limits.d/90-nproc.conf# De...

#centos
    共 12 条
  • 1
  • 2
  • 请选择