加载中
json and go 【翻译update】

JSON(javascript object Notation)是轻量级的数据交换格式 它和Javascript中的对象和数组语法上类似 JSON目前广泛用于前后台数据交互 JSON的官网提供了更多的介绍 Encoding 使用Marshal函数...

2013/12/19 14:43
113
greenlet source code -- g_save

g_save greenlet存在heap上的数据区间由stack_copy 到 stack_copy + stack_saved指定 这里在把greenlet的数据存到heap上时 判断之前的那段区间是否足够存放 如果不够的话 重新申请内存 stat...

2013/09/16 23:36
197
[翻译] go memory model

Introduction The Go memory model specifies the conditions under which reads of a variable in one goroutine can be guaranteed to observe values produced by writes to the same var...

2013/03/06 22:58
959
Revel 重定义错误提示信息

Revel中可以用Validate来检查参数是否正确 用户请求是否给出了某个参数 revel的示例代码如下: func (c MyApp) SaveUser(username string) revel.Result {   // Username (required) must be ...

2013/02/27 23:29
165
[翻译] effective go 之 Errors

Errors Library routines must often return some sort of error indication to the caller. As mentioned earlier, Go's multivalue return makes it easy to return a detailed error desc...

2013/02/23 14:56
304
[翻译] effective go 之 Embedding

Embedding Go does not provide the typical, type-driven notion of subclassing, but it does have the ability to “borrow” pieces of an implementation by embedding types within a ...

2013/02/23 12:12
321
[翻译] effective go 之 Blank identifier

Blank identifier Go defines a special identifier _, called the blank identifier. The blank identifier can be used in a declaration to avoid declaring a name, and it can be used ...

2013/02/23 00:10
322
[翻译] effective go 之 Methods,Interfaces

Methods Pointers vs. Values Methods can be defined for any named type that is not a pointer or an interface; the receiver does not have to be a struct. 除了指针和接口(interface)...

2013/02/20 15:13
216
[翻译] effective go 之 Initialization

Initialization Although it doesn't look superficially very different from initialization in C or C++, initialization in Go is more powerful. Complex structures can be built duri...

2013/02/17 23:47
371
[翻译] effective go 之 Data

Data Allocation with new Go has two allocation primitives, the built-in functions new and make. They do different things and apply to different types, which can be confusing, bu...

2013/02/12 22:20
238
[翻译] effective go 之 Functions

Functions Multiple return values 返回多个值 One of Go's unusual features is that functions and methods can return multiple values. This form can be used to improve on a couple ...

2013/02/06 14:00
356
[翻译] effective go 之 Control structures

Control structures The control structures of Go are related to those of C but differ in important ways. There is no do or while loop, only a slightly generalized for; switch is ...

2013/02/05 23:59
214
[翻译] effective go 之 Names Semicolons

Names Names are as important in Go as in any other language. In some cases they even have semantic effect: for instance, the visibility of a name outside a package is determined...

2013/02/05 12:24
117
[翻译]Interfaces in Go

Interfaces are contracts that exist between an expected implementation of a functionality and its actual implementation. In real life there are innumerable interfaces that we ar...

2013/02/04 14:31
80
[翻译] Anonymous fields in structs - like object ...

Go allows you to define a struct that has fields but with no variable names. These fields are called anonymous fields. Let’s do a few examples to find out what they are and how...

2013/02/03 10:35
202
学习go语言 习题自己的答案 chapter2

package main import ( "fmt" "strings" ) func main() { /* for i := 1; i<=100; i++ { fmt.Println(strings.Repeat("A", i)) ...

2013/02/03 10:27
115
学习go语言 我的习题答案 chapter3

这章节主要讲的是go中函数使用 在做习题过程中碰到的几个比较值得纪念的问题是 定义了命名返回函数 但是没有把它放在括号里面 结果一直编译通不过 但是一眼看过去还是不知道怎么错了A 还有一...

2013/02/03 10:27
79
[翻译]Go 怎么样自己写个包

GOPATH and workspaces One of Go's design goals is to make writing software easier. To that end, the go command doesn't use Makefiles or other configuration files to guide progra...

2013/02/03 10:25
196

没有更多内容

加载失败,请刷新页面

没有更多内容

返回顶部
顶部