remove typo fix

This commit is contained in:
Anchor
2015-01-08 09:52:10 -08:00
268 changed files with 2593 additions and 136 deletions

View File

@@ -32,7 +32,7 @@ Define multiple variables with initial values.
Do you think that it's too tedious to define variables use the way above? Don't worry, because the Go team has also found this to be a problem. Therefore if you want to define variables with initial values, we can just omit the variable type, so the code will look like this instead:
/*
Define three variables with type "type", and initialize their values.
Define three variables without type "type", and initialize their values.
vname1 is v1vname2 is v2vname3 is v3
*/
var vname1, vname2, vname3 = v1, v2, v3
@@ -40,7 +40,7 @@ Do you think that it's too tedious to define variables use the way above? Don't
Well, I know this is still not simple enough for you. Let's see how we fix it.
/*
Define three variables with type "type", and initialize their values.
Define three variables without type "type" and without keyword "var", and initialize their values.
vname1 is v1vname2 is v2vname3 is v3
*/
vname1, vname2, vname3 := v1, v2, v3

View File

@@ -2,13 +2,13 @@
Every time you open your browsers, type some URLs and press enter, you will see beautiful web pages appear on your screen. But do you know what is happening behind these simple actions?
Normally, your browser is a client. After you type a URL, it takes the host part of the URL and sends it to a DNS server in order to get the IP address of the host. Then it connects to the IP address and asks to setup a TCP connection. The browser sends HTTP requests through the connection. The server server handles them and replies with HTTP responses containing the content that make up the web page. Finally, the browser renders bodies of the web pages and disconnects from the server.
Normally, your browser is a client. After you type a URL, it takes the host part of the URL and sends it to a DNS server in order to get the IP address of the host. Then it connects to the IP address and asks to setup a TCP connection. The browser sends HTTP requests through the connection. The server handles them and replies with HTTP responses containing the content that make up the web page. Finally, the browser renders the body of the web page and disconnects from the server.
![](images/3.1.web2.png?raw=true)
Figure 3.1 Processes of users visit a website
A web server, also known as an HTTP server, uses the HTTP protocol to communicate with clients. All web browsers can be considered as clients.
A web server, also known as an HTTP server, uses the HTTP protocol to communicate with clients. All web browsers can be considered clients.
We can divide the web's working principles into the following steps:
@@ -17,7 +17,7 @@ We can divide the web's working principles into the following steps:
- Server returns HTTP response packages to client. If the requested resources include dynamic scripts, server calls script engine first.
- Client disconnects from server, starts rendering HTML.
This is a simple work flow of HTTP affairs -notice that the server closes connections after sending data to clients every time, then waits for the next request.
This is a simple work flow of HTTP affairs -notice that the server closes its connections after it sends data to the clients, then waits for the next request.
## URL and DNS resolution

View File

@@ -45,7 +45,7 @@ Then you need to open a database connection and create a beedb object (MySQL in
}
orm := beedb.New(db)
`beedb.New()` actually has two arguments. The first is the the database opject, and the second is for indicating which database engine you're using. If you're using MySQL/SQLite, you can just skip the second argument.
`beedb.New()` actually has two arguments. The first is the the database object, and the second is for indicating which database engine you're using. If you're using MySQL/SQLite, you can just skip the second argument.
Otherwise, this argument must be supplied. For instance, in the case of SQLServer:

View File

@@ -34,63 +34,64 @@
* [How to use beedb ORM](05.5.md)
* [NOSQL](05.6.md)
* [Summary](05.7.md)
* [Data storage and sessions](06.0.md)
* [sessioncookie](06.1.md)
* [Go如何使用session](06.2.md)
* [session存储](06.3.md)
* [预防session劫持](06.4.md)
* [Data storage and session](06.0.md)
* [Session and cookies](06.1.md)
* [How to use session in Go](06.2.md)
* [Session storage](06.3.md)
* [Prevent hijack of session](06.4.md)
* [Summary](06.5.md)
* [文本文件处理](07.0.md)
* [XML处理](07.1.md)
* [JSON处理](07.2.md)
* [正则处理](07.3.md)
* [模板处理](07.4.md)
* [文件操作](07.5.md)
* [字符串处理](07.6.md)
* [Text files](07.0.md)
* [XML](07.1.md)
* [JSON](07.2.md)
* [Regexp](07.3.md)
* [Templates](07.4.md)
* [Files](07.5.md)
* [Strings](07.6.md)
* [Summary](07.7.md)
* [Web服务](08.0.md)
* [Socket编程](08.1.md)
* [Web services](08.0.md)
* [Sockets](08.1.md)
* [WebSocket](08.2.md)
* [REST](08.3.md)
* [RPC](08.4.md)
* [小结](08.5.md)
* [安全与加密](09.0.md)
* [预防CSRF攻击](09.1.md)
* [确保输入过滤](09.2.md)
* [避免XSS攻击](09.3.md)
* [避免SQL注入](09.4.md)
* [存储密码](09.5.md)
* [加密和解密数据](09.6.md)
* [小结](09.7.md)
* [国际化和本地化](10.0.md)
* [设置默认地区](10.1.md)
* [本地化资源](10.2.md)
* [国际化站点](10.3.md)
* [小结](10.4.md)
* [错误处理,调试和测试](11.0.md)
* [错误处理](11.1.md)
* [使用GDB调试](11.2.md)
* [Go怎么写测试用例](11.3.md)
* [小结](11.4.md)
* [部署与维护](12.0.md)
* [应用日志](12.1.md)
* [网站错误处理](12.2.md)
* [应用部署](12.3.md)
* [备份和恢复](12.4.md)
* [小结](12.5.md)
* [如何设计一个Web框架](13.0.md) 
* [项目规划](13.1.md) 
* [自定义路由器设计](13.2.md)
* [controller设计](13.3.md)
* [日志和配置设计](13.4.md)
* [实现博客的增删改](13.5.md)
* [小结](13.6.md) 
* [扩展Web框架](14.0.md)
* [静态文件支持](14.1.md)
* [Session支持](14.2.md)
* [表单支持](14.3.md)
* [用户认证](14.4.md)
* [多语言支持](14.5.md)
* [pprof支持](14.6.md)
* [小结](14.7.md)
* [参考资料](ref.md)
* [Summary](08.5.md)
* [Security and encryption](09.0.md)
* [CSRF attacks](09.1.md)
* [Filter inputs](09.2.md)
* [XSS attacks](09.3.md)
* [SQL injection](09.4.md)
* [Password storage](09.5.md)
* [Encrypt and decrypt data](09.6.md)
* [Summary](09.7.md)
* [Internationalization and localization](10.0.md)
* [Time zone](10.1.md)
* [Localized resources](10.2.md)
* [International sites](10.3.md)
* [Summary](10.4.md)
* [Error handling, debugging and testing](11.0.md)
* [Error handling](11.1.md)
* [Debugging by using GDB](11.2.md)
* [Write test cases](11.3.md)
* [Summary](11.4.md)
* [Deployment and maintenance](12.0.md)
* [Logs](12.1.md)
* [Errors and crashes](12.2.md)
* [Deployment](12.3.md)
* [Backup and recovery](12.4.md)
* [Summary](12.5.md)
* [Build a web framework](13.0.md)
* [Project program](13.1.md)
* [Customized routers](13.2.md)
* [Design controllers](13.3.md)
* [Logs and configurations](13.4.md)
* [Add, delete and update blogs](13.5.md)
* [Summary](13.6.md)
* [Develop web framework](14.0.md)
* [Static files](14.1.md)
* [Session](14.2.md)
* [Form](14.3.md)
* [User validation](14.4.md)
* [Multi-language support](14.5.md)
* [pprof](14.6.md)
* [Summary](14.7.md)
* [References](ref.md)
* [preface](preface.md)

Binary file not shown.

View File

@@ -11,4 +11,3 @@ This book is a summary of my Go experience, some content are from other gophers'
7. [Network programming with Go](http://jan.newmarch.name/go/)
8. [setup-the-rails-application-for-internationalization](http://guides.rubyonrails.org/i18n.html#setup-the-rails-application-for-internationalization)
9. [The Cross-Site Scripting (XSS) FAQ](http://www.cgisecurity.com/xss-faq.html)
10. [Network programming with Go](http://jan.newmarch.name/go)