1、implicit assignment of unexported field 'username' in models.User literal
The variables defined by the structure in golang are lowercase and cannot be called outside the package
2. 405 error report, add header, it doesn’t work at first, but then it gets better
// 新增content-type头部属性
heads : {
'content-type' : 'application/x-www-form-urlencoded'
},
mac 突然连不上mysql ,记录一下
解决方法:
(1)在终端进入目录:/usr/local/bin
cd /usr/local/bin/
(2)在终端设置mysql命令路径
sudo ln -fs /usr/local/mysql/bin/mysql mysql
。
https://www.jianshu.com/p/65595b0e59ad
Golang reports an error implicit assignment of unexported field
The reason is that the attributes defined by struct start with lowercase and are not public, so they cannot be called across packages!