
Golang
Peiwen123
Clear code
展开
-
Golang 解决跨域问题, 处理http设置header无效
今天遇到跨域问题, 设置了如下配置: w.WriteHeader(http.StatusOK) w.Header().Set("Access-Control-Allow-Origin", "*") w.Header().Add("Access-Control-Allow-Headers", "Content-Type,AccessToken,X-CSRF-Token, Authorization, Token") w.Header().Add("Access-Control-Allow-Creden原创 2021-04-07 18:14:11 · 1770 阅读 · 0 评论 -
【Go by Example】笔记整合
【Go by Example】笔记整合原创 2020-12-24 17:58:47 · 451 阅读 · 1 评论 -
[mac/Golang] CodeRunner中Go问题build cache is required, but could not be located: GOCACHE is not define
今天在CodeRunner遇到报错build cache is required, but could not be located: GOCACHE is not defined and $HOME is not defined意思就是没设置GOCACHE和$HOME;在这里找到了解决方案就是在CodeRunner的Preferences -> Advanced在里面找到Shell Variables添加GOCACHE即可;terminal中使用go env命令可以找到自己GOCAC原创 2020-11-08 00:26:30 · 3251 阅读 · 0 评论