Translate 01.3
This commit is contained in:
18
th/01.3.md
18
th/01.3.md
@@ -1,14 +1,14 @@
|
||||
# 1.3 Go commands
|
||||
# 1.3 คำสั่งต่างๆ ของ Go
|
||||
|
||||
## Go commands
|
||||
## คำสั่งต่างๆ ของ Go
|
||||
|
||||
The Go language comes with a complete set of command operation tools. You can execute the `go` command on the terminal to see them:
|
||||
ภาษา Go นั้นมาพร้อมกับเครื่องมือใช้งานแบบคำสั่ง (command) ที่ครบสมบูรณ์่่้้ เราสามารถสั่งรันคำสั่ง `go` บน terminal เพื่อดูคำสั่งเหล่านั้น:
|
||||
|
||||

|
||||
|
||||
Figure 1.3 Go command displays detailed information
|
||||
รูป 1.3 คำสั่ง Go จะแสดงข้อมูลรายละเอียด
|
||||
|
||||
These are all useful for us. Let's see how to use some of them.
|
||||
คำสั่งทั้งหมดนี้เป็นคำสั่งที่มีประโยชน์ทั้งหมด เรามาดูวิธีการใช้งานกัน
|
||||
|
||||
## go build
|
||||
|
||||
@@ -45,7 +45,7 @@ This command is for cleaning files that are generated by compilers, including th
|
||||
|
||||
I usually use this command to clean up my files before I upload my project to Github. These are useful for local tests, but useless for version control.
|
||||
|
||||
## go fmt and gofmt
|
||||
## go fmt และ gofmt
|
||||
|
||||
The people who are working with C/C++ should know that people are always arguing about which code style is better: K&R-style or ANSI-style. However in Go, there is only one code style which is enforced. For example, left braces must only be inserted at the end of lines, and they cannot be on their own lines, otherwise you will get compile errors! Fortunately, you don't have to remember these rules. `go fmt` does this job for you. Just execute the command `go fmt <File name>.go` in terminal. I don't use this command very much because IDEs usually execute this command automatically when you save source files. I will talk more about IDEs in the next section.
|
||||
|
||||
@@ -87,7 +87,7 @@ So how do we look up package information in documentation? For instance, if you
|
||||
|
||||
Execute the `godoc -http=:8080` command, then open `127.0.0.1:8080` in your browser. You should see a localized golang.org. It can not only show the standard packages' information, but also packages in your `$GOPATH/pkg`. It's great for people who are suffering from the Great Firewall of China.
|
||||
|
||||
## Other commands
|
||||
## คำสั่งอื่นๆ
|
||||
|
||||
Go provides more commands than those we've just talked about.
|
||||
|
||||
@@ -102,5 +102,5 @@ There are also more details about the commands that I've talked about. You can u
|
||||
## Links
|
||||
|
||||
- [Directory](preface.md)
|
||||
- Previous section: [$GOPATH and workspace](01.2.md)
|
||||
- Next section: [Go development tools](01.4.md)
|
||||
- บทก่อนหน้า: [$GOPATH และ workspace](01.2.md)
|
||||
- บทถัดไป: [เครื่องมือในการพัฒนาของ Go](01.4.md)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
- 1.[การตั้งค่าสภาพแวดล้อมของ Go](01.0.md)
|
||||
- 1.1. [การติดตั้ง](01.1.md)
|
||||
- 1.2. [$GOPATH และ workspace](01.2.md)
|
||||
- 1.3. [Go commands](01.3.md)
|
||||
- 1.3. [คำสั่งต่างๆ ของ Go](01.3.md)
|
||||
- 1.4. [Go development tools](01.4.md)
|
||||
- 1.5. [Summary](01.5.md)
|
||||
- 2.[Go basic knowledge](02.0.md)
|
||||
|
||||
Reference in New Issue
Block a user