AI智能
改变未来

Go语言 第65页

beego上传图片到阿里云oss-爱站程序员基地

beego上传图片到阿里云oss

AI

  [code]//oss上传func (c *BaseController) OssUploadImg(picName string) (string, error) {//获取上传的文件f, h, err := c.GetFile(pi...

Binary search algorithm-爱站程序员基地

Binary search algorithm

AI

public class binarySearch{public static int binarySearch(int [] nums, int target){int left=0, right=nums.length-1; while...

[系列] Go - 统一定义 API 错误码-爱站程序员基地

[系列] Go – 统一定义 API 错误码

AI

改之前 在使用 gin 开发接口的时候,返回接口数据是这样写的。 type response struct {Code int `json:\"code\"`Msg string `json:\"msg\"`Data interface{}...

Cassandra Gossip协议的二三事儿-爱站程序员基地

Cassandra Gossip协议的二三事儿

AI

Gossip协议是Cassandra维护各节点状态的一个重要组件,下面我们以Gossip协议三次握手为线索逐步分析Gossip协议源码。 Gossip协议通过判断节点的generation和version 来确认节点状态信息新旧,如果节点重...

[系列] Go - time.RFC3339 时间格式化-爱站程序员基地

[系列] Go – time.RFC3339 时间格式化

AI

在开发过程中,我们有时会遇到这样的问题,将 2020-11-08T08:18:46+08:00 转成 2020-11-08 08:18:46 ,怎么解决这个问题? 解决这个问题,最好不要用字符串截取,或者说字符串截取是最笨的方法,这应该是时...

[etcd]raftpd confstate.go-爱站程序员基地

[etcd]raftpd confstate.go

AI

_________________看前须知__________________ [code]message ConfState {// The voters in the incoming config. (If the configura...