Go
AdleyTales
这个作者很懒,什么都没留下…
展开
-
go 原生的server服务
package mainimport ( "fmt" "net/http")func main() { http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { fmt.Println(r.RequestURI) // 路由设计的原理 url := r.RequestURI if url == "/" { w.Write([]byte("hello go~")) return }原创 2020-10-20 09:48:25 · 384 阅读 · 0 评论 -
go 冒泡排序
package mainimport ( "time" "fmt")func bubbleSort(arr []int) []int{ n := len(arr) for i:=0; i< n-1; i++ { for j:=0; j< n-1-i; j++ { if arr[j] > arr[j+1]{ tmp := arr[j] arr[j] = arr[j+1] arr[j+1] = tmp } } }原创 2020-05-18 21:58:47 · 393 阅读 · 0 评论 -
goland 设置控制台折叠 #gosetup 环境变量
1、快捷键 ctrl(cmd) + shift + A2、输入 Registry3、取消 run.process.with.pty的勾选,然后关闭即可原创 2020-03-28 18:37:29 · 6541 阅读 · 9 评论 -
goland 2019破解
http://idea.lanyus.com/原创 2019-03-22 09:17:18 · 3614 阅读 · 0 评论 -
go aes对称加解密
package mainimport ( "bytes" "crypto/aes" "crypto/cipher" "encoding/base64" "fmt")const ( key = "2018201820182018" iv = "1234567887654321")func main() { str := "abcd" es, _ := AesEnc...原创 2019-03-26 17:19:51 · 432 阅读 · 0 评论 -
go md5 签名
package mainimport ( "crypto/md5" "encoding/hex" "fmt")func main() { res := MD5("fhjdshfjk shjkfhsd") fmt.Println(res) // c9c3e4a4c2c257450cd74a30a153e8fd}func MD5(text string) string { ...原创 2019-03-26 17:20:17 · 1477 阅读 · 0 评论 -
go sh256签名加密
package mainimport ( "crypto/hmac" "crypto/sha256" "encoding/base64" "encoding/hex" "fmt")func main() { res := SHA256("jdlsjfkjhfj123232") fmt.Println(res) // c40bad10eca3f4e355b313abfe44d...原创 2019-03-26 17:20:50 · 664 阅读 · 0 评论 -
一些不常见的Go命令参数详解
https://blog.csdn.net/erlib/article/details/52703165转载 2019-03-27 11:15:33 · 271 阅读 · 0 评论 -
go常用时间 time
package mainimport ( "fmt" "time")func main() { fmt.Println(time.Now()) // 2019-03-29 10:02:42.12163 +0800 CST m=+0.000330682 // 秒 fmt.Println(time.Now().Unix()) // 1553825171 // 纳秒...原创 2019-03-29 10:29:43 · 984 阅读 · 0 评论