From 7e58b251dd8bdb224b38cf5e4550ad2e1a6ac797 Mon Sep 17 00:00:00 2001 From: Jeff Haynie Date: Thu, 30 Nov 2017 07:51:23 -0800 Subject: [PATCH 1/4] Fix example to close the rows object --- en/05.2.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/en/05.2.md b/en/05.2.md index 96dc2292..943e9917 100644 --- a/en/05.2.md +++ b/en/05.2.md @@ -80,6 +80,8 @@ The following example shows how to operate on a database based on the `database/ fmt.Println(department) fmt.Println(created) } + + rows.Close() // delete stmt, err = db.Prepare("delete from userinfo where uid=?") From 301ef4b1747c475b8a7afd86e03ea39f4a2e18d8 Mon Sep 17 00:00:00 2001 From: yuansmin Date: Thu, 21 Dec 2017 13:20:29 +0800 Subject: [PATCH 2/4] fix example User --- zh/05.5.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zh/05.5.md b/zh/05.5.md index 0cecacf8..9698eb8e 100644 --- a/zh/05.5.md +++ b/zh/05.5.md @@ -221,7 +221,7 @@ func init() { ``` ->注意一点,beego orm针对驼峰命名会自动帮你转化成下划线字段,例如你定义了Struct名字为`User`,那么转化成底层实现的时候是`user_info`,字段命名也遵循该规则。 +>注意一点,beego orm针对驼峰命名会自动帮你转化成下划线字段,例如你定义了Struct名字为`UserInfo`,那么转化成底层实现的时候是`user_info`,字段命名也遵循该规则。 ## 插入数据 下面的代码演示了如何插入一条记录,可以看到我们操作的是struct对象,而不是原生的sql语句,最后通过调用Insert接口将数据保存到数据库。 From e9fabce626523305a4238f334abbe2e252710141 Mon Sep 17 00:00:00 2001 From: Emre Keskin Date: Thu, 21 Dec 2017 23:27:33 +0300 Subject: [PATCH 3/4] Update 02.2.md a small arrangement --- tr/02.2.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tr/02.2.md b/tr/02.2.md index a5a8084e..cb9388f6 100644 --- a/tr/02.2.md +++ b/tr/02.2.md @@ -38,7 +38,7 @@ Aslında bu çözümünde yeterince basit olmadığını biliyorum. Bakalım dah Şimdi daha iyi gibi.`:=` kullanarak `var` ve `type` ihmal edilebiliyor, buna öz ifade deniyor. Ama bir dakika, tek bir şart var: bu yöntemi sadece fonksiyon içinde kullanabilirsiniz. Fonksiyon gövdesi dışında kullanırsanız derleme hatası alırsnız. Bundan dolayı, global değişkenler için `var` kullanıyoruz ve kısa tanımalar içinde `var()` anahtar kelimesini. -`_` (boş) özel bir değişken ismi. Verilen her değer yoksayılır. Örneğin, `35`değerini `b`'ye' atıyoruz ve`34` değerini yoksayıyoruz.( ***Bu örnek sadece nasıl çalıştığını gösteriyor. Genelde fonksiyonlardan dönen değerleri yoksaymak iiçin kullanıyoruz*** ) +`_` (boş) özel bir değişken ismi. Verilen her değer yoksayılır. Örneğin, `35`değerini `b`'ye' atıyoruz ve`34` değerini yoksayıyoruz.( ***Bu örnek sadece nasıl çalıştığını gösteriyor. Genelde fonksiyonlardan dönen değerleri yoksaymak için kullanıyoruz*** ) _, b := 34, 35 From 986d27a143a696a6fbf3cceb1d9abf610c220346 Mon Sep 17 00:00:00 2001 From: Jason Rogena Date: Fri, 22 Dec 2017 12:27:30 +0300 Subject: [PATCH 4/4] 'is in' Grammatical Error In en/02.1 Fix a grammatical error in en/02.1 by changing the following sentence from: One of the significant improvements in in code formatting. to: One of the significant improvements is in code formatting. Signed-off-by: Jason Rogena --- en/02.1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/en/02.1.md b/en/02.1.md index a2b4f0d6..63e1e881 100644 --- a/en/02.1.md +++ b/en/02.1.md @@ -19,7 +19,7 @@ While this might seem to be a shallow problem, when the codebase grows and more For other languages there are many variables when it comes to writing code. Every language is good for its use case, but Go is a little special because it was designed at a company which is the very synonym of the Internet (and distributed computing). Typically in order to optimize programs, developers choose to write Java over Python and C++ over Java, but almost all available languages widely in use were written decades ago when 1GB storage was much pricier. Now storage and computing is relatively cheap and computers are getting multiples cores, but the "old languages" are not harnessing concurrency in a way that go does. It's not because those languages are bad; utilizing concurrency wasn't a relevant usecase while the older languages evolved. -To mitigate all the problems that Google faced with current tools, they wrote a systems language called Go which you are about to learn! There are many advantages to using golang and there are disadvantages too, for every coin has both sides. One of the significant improvements in in code formatting. Google has designed the language to avoid debates on code formatting. Go code written by anyone in the world (assuming they know and use `gofmt`) will look exactly the same. This won't seem to matter until you work in a team! Also when the company uses automated code review or some other fancy technique, the formatted code may break in other languages which don't have strict and standard formatting rules, but not in go! +To mitigate all the problems that Google faced with current tools, they wrote a systems language called Go which you are about to learn! There are many advantages to using golang and there are disadvantages too, for every coin has both sides. One of the significant improvements is in code formatting. Google has designed the language to avoid debates on code formatting. Go code written by anyone in the world (assuming they know and use `gofmt`) will look exactly the same. This won't seem to matter until you work in a team! Also when the company uses automated code review or some other fancy technique, the formatted code may break in other languages which don't have strict and standard formatting rules, but not in go! Go was designed with concurrency in mind, please note that parallelism != concurrency, there is an [amazing post](https://blog.golang.org/concurrency-is-not-parallelism) by Rob Pike on the [golang blog](https://blog.golang.org/), you will find it there, it is worth a read.