
生成区间随机数
func RandInt(min, max int) int {
if min >= max || min == 0 || max == 0 {
return max
}
return rand.Intn(max-min) + min}
生成指定区间随机数(包括纯数字/纯字母/随机)
const (
KC_RAND_KIND_NUM = 0 // 纯数字
KC_RAND_KIND_LOWER = 1 // 小写字母
KC_RAND_KIND_UPPER = 2 // 大写字母
KC_RAND_KIND_ALL = 3 // 数字、大小写字母)// 随机字符串func Krand(size int, kind int) []byte {
ikind, kinds, result := kind, [][]int{[]int{10, 48}, []int{26, 97}, []int{26, 65}}, make([]byte, size)
is_all := kind > 2 || kind <p>推荐学习《<a href="https://www.php.cn/be/go/" target="_self">golang教程</a>》<br></p><div class="aritcle_card flexRow artxards">
<div class="artcardd flexRow">
<a class="aritcle_card_img" rel="nofollow" href="/ai/1131" title="HitPaw"><img
src="https://img.php.cn/upload/ai_manual/000/000/000/175680063848936.png" alt="HitPaw" onerror="this.onerror='';this.src='/static/lhimages/moren/morentu.png'" ></a>
<div class="aritcle_card_info flexColumn">
<a rel="nofollow" href="/ai/1131" title="HitPaw" class="overflowclass">HitPaw</a>
<p class="overflowclass">HitPaw是一套覆盖视频编辑、图片增强、音视频转换和 AI 修复的多媒体工具。</p>
</div>
<a rel="nofollow" href="/ai/1131" title="HitPaw" class="aritcle_card_btn flexRow flexcenter"><b></b><span>下载</span>
</a>
</div>
</div>
golang免费学习笔记(深入):立即使用
在学习笔记中,你将探索golang的核心概念和高级技巧!










