- 博客(5)
- 收藏
- 关注
原创 remote: HTTP Basic: Access denied. The provided password or token is incorrect or your account 解决方案
remote: HTTP Basic: Access denied. The provided password or token is incorrect or your account has 2FA enabled and you must use a personal access token instead of a password.
2024-04-16 11:59:18
2631
1
原创 【golang】json解析为map[string]interface{}数字格式问题解决方案
有些需求场景,我们不需要知道json完整数据结构,只需要针对其中个别字段做处理,再将其转换为json等等,这种情况下,可以将json解析为map[string]interface{}格式。可使用Decoder.UseNumber函数,将数字解析为json.Number类型,再根据需要将其解析为期望格式。参考文章:https://blog.cyeam.com/golang/2018/08/22/json-number。特别说明:json.Number类型 转换为json时,会被转换为数字类型。
2023-09-22 15:43:27
525
原创 Golang实现请求http post接口上传文件demo及注意事项
io.Read、io.Copy ,文件使用此方法读取完成后,offset在文件末尾,如果想再次读取文件内容,需要先使用Seek函数重置偏移位为文件初始位置,再进行读取;否则 再次读到的文件内容为空!比如有个应用场景是先计算文件的md5,再将文件、md5作为入参请求http post接口。
2023-06-27 15:04:13
1820
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人