03 2018 档案

摘要:make用于内建类型(map、slice 和channel)的内存分配 new用于各种类型的内存分配 new(T)分配了零值填充的T类型的内存空间, 并且返回其地址,即一个*T类型的值 内建函数make(T, args)与new(T)有着不同的功能,make只能创建slice、map和channel 阅读全文
posted @ 2018-03-31 21:36 hao.ma 阅读(204) 评论(0) 推荐(0)
摘要:Role: kind: Role apiVersion: rbac.authorization.k8s.io/v1 metadata: namespace: gauss name: gauss-op rules: - apiGroups: ["*"] resources: ["*"] verbs: 阅读全文
posted @ 2018-03-27 19:18 hao.ma 阅读(301) 评论(0) 推荐(0)
摘要:package main import "fmt" type Currency string type Amount struct { Currency Currency Value float32 } type Balance map[Currency]float32 func (b *Balance) Add(amount Amount) *Balance { ... 阅读全文
posted @ 2018-03-15 20:54 hao.ma 阅读(1687) 评论(0) 推荐(0)