Fix grammar and typos for 01.4.md [en]
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
# Go development tools
|
||||
|
||||
In this section, I'm going to show you some IDEs that have abilities of intelligent completion and auto-format. There are all cross-platform, so the steps I show you should not be very different if you are not using same operating system.
|
||||
In this section, I'm going to show you a few IDEs that can help you become a more efficient programmer, with capabilities such as intelligent code completion and auto-formatting. They are all cross-platform, so the steps I will be showing you should not be very different, even if you are not using the same operating system.
|
||||
|
||||
## LiteIDE
|
||||
|
||||
LiteIDE is an open source, lightweight IDE for developing Go project only, developed by visualfc.
|
||||
LiteIDE is an open source, lightweight IDE for developing Go projects only, developed by visualfc.
|
||||
|
||||

|
||||
|
||||
@@ -17,18 +17,18 @@ LiteIDE features.
|
||||
- Linux
|
||||
- Mac OS
|
||||
- Cross-compile
|
||||
- Manage multiple compile environment
|
||||
- Supports cross-compile of Go
|
||||
- Manage multiple compile environments
|
||||
- Supports cross-compilation of Go
|
||||
- Project management standard
|
||||
- Documentation view based on $GOPATH
|
||||
- Compile system based on $GOPATH
|
||||
- Compilation system based on $GOPATH
|
||||
- API documentation index based on $GOPATH
|
||||
- Go source code editor
|
||||
- Code outlining
|
||||
- Full support of gocode
|
||||
- Go documentation view and API index
|
||||
- View code expression by `F1`
|
||||
- Function declaration jump by `F2`
|
||||
- View code expression using `F1`
|
||||
- Function declaration jump using `F2`
|
||||
- Gdb support
|
||||
- Auto-format with `gofmt`
|
||||
- Others
|
||||
@@ -50,17 +50,17 @@ LiteIDE features.
|
||||
- [Download page](http://code.google.com/p/golangide)
|
||||
- [Source code](https://github.com/visualfc/liteide)
|
||||
|
||||
You need to install Go first, then download the version of your operating system. Decompress the package to direct use.
|
||||
You need to install Go first, then download the version appropriate for your operating system. Decompress the package to directly use it.
|
||||
- Install gocode
|
||||
|
||||
You have to install gocode in order to use intelligent completion
|
||||
|
||||
go get -u github.com/nsf/gocode
|
||||
|
||||
- Compile environment
|
||||
- Compilation environment
|
||||
|
||||
Switch configuration in LiteIDE that fits your operating system.
|
||||
In Windows and 64-bit version of Go, you should choose win64 in environment configuration in tool bar. Then you choose `opinion`, find `LiteEnv` in the left list, open file `win64.env` in the right list.
|
||||
Switch configuration in LiteIDE to suit your operating system.
|
||||
In Windows and using the 64-bit version of Go, you should choose win64 as the configuration environment in the tool bar. Then, choose `opinion`, find `LiteEnv` in the left list and open file `win64.env` in the right list.
|
||||
|
||||
GOROOT=c:\go
|
||||
GOBIN=
|
||||
@@ -73,7 +73,7 @@ LiteIDE features.
|
||||
|
||||
Replace `GOROOT=c:\go` to your Go installation path, save it. If you have MinGW64, add `c:\MinGW64\bin` to your path environment variable for `cgo` support.
|
||||
|
||||
In Linux and 64-bit version of Go, you should choose linux64 in environment configuration in tool bar. Then you choose `opinion`, find `LiteEnv` in the left list, open file `linux64.env` in the right list.
|
||||
In Linux and using the 64-bit version of Go, you should choose linux64 as the configuration environment in the tool bar. Then, choose `opinion`, find `LiteEnv` in the left list and open the `linux64.env` file in the right list.
|
||||
|
||||
GOROOT=$HOME/go
|
||||
GOBIN=
|
||||
@@ -86,8 +86,8 @@ LiteIDE features.
|
||||
|
||||
Replace `GOROOT=$HOME/go` to your Go installation path, save it.
|
||||
- $GOPATH
|
||||
$GOPATH is the path that contains project list, open command tool (or press `Ctrl+` in LiteIDE) then type `go help gopath` for more details.
|
||||
It's very easy to view and change $GOPATH in the LiteIDE. Follow `View - Setup GOPATH` to view and change these values.
|
||||
$GOPATH is the path that contains a list of projects. Open the command tool (or press `Ctrl+` in LiteIDE), then type `go help gopath` for more details.
|
||||
It's very easy to view and change $GOPATH in LiteIDE. Follow `View - Setup GOPATH` to view and change these values.
|
||||
|
||||
## Sublime Text
|
||||
|
||||
@@ -106,15 +106,15 @@ Here I'm going to introduce you the Sublime Text 2 (Sublime for short) + GoSubli
|
||||
Figure 1.6 Sublime project management
|
||||
|
||||
- Syntax highlight
|
||||
- Free trail forever, no functions limit. It will pop-up unregistered prompt sometimes, but you can just ignore it.
|
||||
- Free trial forever with no functional limitations. You may be prompted once in a while to remind you to purchase a licnese, but you can simply ignore it if you wish. Of course, if you do find that it enhances your productivity and you really enjoy using it, please purchase a copy of it and support its continued development!
|
||||
|
||||
First, download the version of [Sublime](http://www.sublimetext.com/) that fits your operating system.
|
||||
First, download the version of [Sublime](http://www.sublimetext.com/) suitable for your operating system.
|
||||
|
||||
1. Press `Ctrl+` ` open command tool, input following commands.
|
||||
1. Press `Ctrl+`, open the command tool and input the following commands.
|
||||
|
||||
import urllib2,os; pf='Package Control.sublime-package'; ipp=sublime.installed_packages_path(); os.makedirs(ipp) if not os.path.exists(ipp) else None; urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler())); open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read()); print 'Please restart Sublime Text to finish installation'
|
||||
|
||||
Restart when installation finished. Then you can find `Package Control` item in the Preferences menu.
|
||||
Restart Sublime text when the installation has finished. You should then find a `Package Control` option in the "Preferences" menu.
|
||||
|
||||

|
||||
|
||||
@@ -125,26 +125,26 @@ First, download the version of [Sublime](http://www.sublimetext.com/) that fits
|
||||
|
||||
Figure 1.8 Sublime Install Packages
|
||||
|
||||
Now you type GoSublime, press OK to install, same steps for installing SidebarEnhancements and Go Build. Restart when it finished installation.
|
||||
3. To verify if installation is successful, open Sublime, then open file `main.go` to see if it has syntax highlight, type `import` to see if it has prompts, after typed `import "fmt"`, type `fmt.` to see if it has intelligent completion for functions.
|
||||
Now type in "GoSublime", press OK to install the package, and repeat the same steps for installing SidebarEnhancements and Go Build. Once again, restart the editor when it completes the installation.
|
||||
3. To verify that the installation is successful, open Sublime, then open the `main.go` file to see if it has the proper syntax highlighting. Type `import` to see if code completion prompts appear. After typing `import "fmt"`, type `fmt.` anywhere after the `import` declaration to see whether or not intelligent code completion for functions was successfully enabled.
|
||||
|
||||
If everything is fine, you're all set.
|
||||
|
||||
If not, check your $PATH again. Open terminal, type `gocode`, if it cannot run, your $PATH must not configure correctly.
|
||||
If not, check your $PATH again. Open terminal, type `gocode`. If it does not run, your $PATH was not configured correctly.
|
||||
|
||||
## Vim
|
||||
|
||||
Vim a popular text editor for programmers, which is developing from vi. It has functions for intelligent completion, compile and jump to errors.
|
||||
Vim is a popular text editor for programmers, which evolved from its slimmer predecessor, Vi. It has functions for intelligent completion, compilation and jumping to errors.
|
||||
|
||||

|
||||
|
||||
Figure 1.8 Vim intelligent completion for Go
|
||||
|
||||
1. Syntax highlight for Go
|
||||
1. Syntax highlighting for Go
|
||||
|
||||
cp -r $GOROOT/misc/vim/* ~/.vim/
|
||||
|
||||
2. Set syntax highlight on
|
||||
2. Enabling syntax highlighting
|
||||
|
||||
filetype plugin indent on
|
||||
syntax on
|
||||
@@ -154,6 +154,7 @@ Figure 1.8 Vim intelligent completion for Go
|
||||
go get -u github.com/nsf/gocode
|
||||
|
||||
gocode will be installed in `$GOBIN` as default
|
||||
|
||||
4. Configure [gocode](https://github.com/nsf/gocode/)
|
||||
|
||||
~ cd $GOPATH/src/github.com/nsf/gocode/vim
|
||||
@@ -166,22 +167,22 @@ Figure 1.8 Vim intelligent completion for Go
|
||||
propose-builtins true
|
||||
lib-path "/home/border/gocode/pkg/linux_amd64"
|
||||
|
||||
Explanation of gocode set.
|
||||
Explanation of gocode configuration:
|
||||
|
||||
propose-builtins: whether open intelligent completion or not, false as default.
|
||||
|
||||
lib-path: gocode only search packages in `$GOPATH/pkg/$GOOS_$GOARCH` and `$GOROOT/pkg/$GOOS_$GOARCH`, this setting can add additional path.
|
||||
propose-builtins: specifies whether or not to open intelligent completion; false by default.
|
||||
lib-path: gocode only searches for packages in `$GOPATH/pkg/$GOOS_$GOARCH` and `$GOROOT/pkg/$GOOS_$GOARCH`. This setting can be used to add additional paths.
|
||||
|
||||
5. Congratulations! Try `:e main.go` to experience the world of Go!
|
||||
|
||||
## Emacs
|
||||
|
||||
Emacs is so-called Weapon of God. She is not only an editor, also a powerful IDE.
|
||||
Emacs is the so-called Weapon of God. She is not only an editor, but also a powerful IDE.
|
||||
|
||||

|
||||
|
||||
Figure 1.10 Emacs main panel of Go editor
|
||||
|
||||
1. Syntax highlight
|
||||
1. Syntax highlighting
|
||||
|
||||
cp $GOROOT/misc/emacs/* ~/.emacs.d/
|
||||
|
||||
@@ -304,15 +305,15 @@ Figure 1.10 Emacs main panel of Go editor
|
||||
(interactive)
|
||||
(show-all)
|
||||
(shell-command-on-region (point-min) (point-max) "go tool fix -diff"))
|
||||
6. Congratulations! speedbar is closed as default, cut comment symbols in line `;;(speedbar 1)` to have this feature, or you can have it through `M-x speedbar`.
|
||||
6. Congratulations, you're done! Speedbar is closed by default -remove the comment symbols in the line `;;(speedbar 1)` to enable this feature, or you can use it through `M-x speedbar`.
|
||||
|
||||
## Eclipse
|
||||
|
||||
Eclipse is also a great development tool, I'll show you how to use it to write Go programs.
|
||||
Eclipse is also a great development tool. I'll show you how to use it to write Go programs.
|
||||
|
||||

|
||||
|
||||
Figure 1.1 Eclipse main panel of Go editor
|
||||
Figure 1.1 Eclipse main panel for editing Go
|
||||
|
||||
1. Download and install [Eclipse](http://www.eclipse.org/)
|
||||
2. Download [goclipse](https://code.google.com/p/goclipse/)
|
||||
@@ -352,7 +353,7 @@ Figure 1.1 Eclipse main panel of Go editor
|
||||

|
||||
|
||||
Figure 1.14 gdb Setting
|
||||
6. Check installation
|
||||
6. Check the installation
|
||||
|
||||
Create a new Go project and hello.go file as following.
|
||||
|
||||
@@ -368,26 +369,26 @@ Figure 1.1 Eclipse main panel of Go editor
|
||||
|
||||
## IntelliJ IDEA
|
||||
|
||||
People who are working with Java should be familiar with this IDE, it supports Go syntax highlight, intelligent completion and reconstructed by a plugin.
|
||||
People who have worked with Java should be familiar with this IDE. It supports Go syntax highlighting and intelligent code completion, implemented by a plugin.
|
||||
|
||||
1. Download IDEA, there is no different from Ultimate and Community Edition
|
||||
1. Download IDEA, there is no difference between the Ultimate and Community editions
|
||||
|
||||

|
||||
|
||||
2. Install Go plugin. Choose `File - Setting - Plugins`, then click `Browser repo`.
|
||||
2. Install the Go plugin. Choose `File - Setting - Plugins`, then click `Browser repo`.
|
||||
|
||||

|
||||
|
||||
3. Search `golang`, double click `download and install`, wait for downloading.
|
||||
3. Search `golang`, double click `download and install` and wait for the download to complete.
|
||||
|
||||

|
||||
|
||||
Click `Apply`, then restart.
|
||||
4. Now you can create Go project.
|
||||
4. Now you can create a Go project.
|
||||
|
||||

|
||||
|
||||
Input position of go sdk in the next step, basically it's your $GOROOT.
|
||||
Input the position of your Go sdk in the next step -basically it's your $GOROOT.
|
||||
|
||||
( ***See a [blog post](http://wuwen.org/tips-about-using-intellij-idea-and-go/) for setup and use IntelliJ IDEA with Go step by step *** )
|
||||
|
||||
|
||||
Reference in New Issue
Block a user