-
Go笔记7:并发
Golang 给人印象最深刻的一个特性就是:从语言层面支持并行,而且实现起来相当简单。 goroutinegoroutine是Go并行设计的核心。goroutine其实就是协程,它比线程更小,十几个goroutine可能体现在底层就是五六个线程,Go... -
Go笔记6:Go数据结构
结构与指针定义一个叫Point的简单的结构类型,意味着内存里是两个相邻的int。 1type Point struct { X , Y int } Point{ 10, 20 }表示一个被初始化的Point对象。&a... -
在Sublime Text2中开发Golang
Sublime Text 2 是一个可定制程度相当高的轻量级编辑器,具有丰富的第三方插件,关键是可以无限期的免费使用。下面就介绍通过安装几种插件,将Sublime Text 2定制成为一款相当好用的Golang IDE。 下载 下载Sublime... -
Go笔记5:访问MySQL数据库
安装驱动MySQL驱动: https://github.com/go-sql-driver/mysql 。 1$ go get github.com/go-sql-driver/mysql 连接数据库1234567import ( "... -
Go笔记4:接口
什么是接口(interface)Golang中的interface是一组method的组合,我们通过interface来定义对象的一组行为。如果某个对象实现了某个接口的所有方法,则此对象就实现了此接口。 比如: 12345678910111213... -
Go笔记3:面向对象
Go是一个面向对象的语言,但是不同于Java,C++中略显复杂的面向对象思想,Golang 则将 OOP 思想做了极大的简化,只留下了最核心的特征:你可以给任何类型(包括内置类型)“增加”新方法。而在实现某个接口时,只需要实现该接口要求的所有方法即可... -
Spring MVC 实现 REST service
web.xml123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051<!-- 配置字符过滤器--> ... -
使用Spring Data JPA 简化持久层的开发
最近看到SpringSide 最新版的技术选型 中提到了Spring Data JPA ,号称只需要实现接口就可以实现大部分操作。真有怎么神奇?于是Google一番,果然好使,在这里记录一下:
-
Go笔记2:基础语法
变量说明: 使用var关键字是Go最基本的定义变量方式,Go把变量类型放在变量名后面; _(下划线)是个特殊的变量名,任何赋予它的值都会被丢弃; 1_, b := 34, 35 //将值35赋予b,并同时丢弃34 Go对于已声明... -
Go笔记1:环境配置
Go 安装我的环境是Win7,所以这里主要记录在Win7下安装Go的过程: 首先到这里 去下载安装程序,32位系统下载go1.0.3.windows-386.msi,64位系统下载go1.0.3.windows-amd64.msi; 双击打开下...