随笔分类 - golang
摘要:年前没钱,等发工资。就这么在公司耗着不敢回家,无聊看了下golang的sort源码 type Interface interface { // Len is the number of elements in the collection. Len() int // Less reports whe
阅读全文
摘要:golang的defer怎么说。大意就是在函数return后。函数关闭前。按照filo的顺序来执行的关键字上代码:package mainimport ( "fmt")func main() { // a() fmt.Println(c()) // b() // fmt...
阅读全文
摘要:用一个数组代表柱形墙的的高度。当下雨的时候柱形墙能积水的体积是多少下面是python的实现算法:# -*- coding: utf-8 -*-def savewater(arr): point_l=0 max_l=arr[0] point_r=len(arr)-1 max_r...
阅读全文
摘要:1、创建engineengine, err := xorm.NewEngine(driverName, dataSourceName)上述代码创建了一个数据库引擎,可以在一个程序中创建多个engine。2、查询方法:2.1、支持sql查询: 1、查询一个string类型的sql,返回[]map[s...
阅读全文
摘要:json就是简单的数据交换格式,语法类似javascript的对象和列表,是最常见的后端和运行在网页上的js之间的通信格式。encoding:编码json数据需要使用到Marshal()函数。func Marshal(v interface{}) ([]byte, error)type Messag...
阅读全文
摘要:一:首先man.go,整个程序的入口func main() { beego.Run()}然后beego.run()代码// Run beego application.// beego.Run() default run on HttpPort// beego.Run(":8089")// b...
阅读全文

浙公网安备 33010602011771号