What is GoClipse
GoClipse is an Eclipse IDE plug-in for go language development. It has many features and code completion functions through GoCode; it is a very good editor with complete code completion. , abstract syntax tree view, project management and program debugging functions. Code completion is generally implemented through the built-in GoCode. If you need to install GoCode manually, enter the command "go get -u github.com/nsf/gocode" on the command line.
The operating environment of this tutorial: Windows 7 system, Dell G3 computer.
What is GoClipse
GoClipse is an Eclipse IDE plug-in that has many features and code completion functions through GoCode. It relies on the famous large-scale development environment Eclipse. Although it requires the installation of a JVM runtime environment, it can easily enjoy many functions of Eclipse itself. This is a very good editor with complete code completion, abstract syntax tree view, project management and program debugging functions.
#If you are not very familiar with integrated development environments, then use LiteIDE. GoClipse or IntelliJ Idea Plugin are also good choices.
Code completion is generally implemented through built-in GoCode (such as: LiteIDE, GoClipse). If you need to install GoCode manually, enter the command go get -u github.com/nsf/gocode on the command line.
That's it (be sure to configure the Go environment variables in advance).
Eclipse installation and configuration goclipse plug-in
##1. Install the goclipse plug-in:
GoClipse/goclipse/Installation.md
Of course, there are certain version requirements to install goclipse. The official requirements are as follows:Installation Requirements:- Java VM version 8 or later.- Eclipse 4.6 (Neon) or later.- CDT 9.0 or later (this will be installed or updated automatically as part of the steps below).
Offline installation:
- First, download
- goclipse resource package, and then decompress the compressed package. Then, open Eclipse, click
- Help
->
Install New Software...->
Add, fill in the plug-in description, And click
Localto locate and select the
releasesdirectory under the decompression directory of the downloaded resource package, and click
Ok:
If - CDT
has been installed, then only select
GoClipse. If
CDTis not installed, you need to select the first three items:
CDT Main Features,
CDT Optional Featuresand
GoClipse, and then press
Nextuntil the installation is complete.
Online installation:
Click on the menu bar and clickHelp ->
Install New Software... ->
Add, and then fill in the address URL of
goclipse in
Archive...:
http://goclipse.github. io/releases/, the remaining steps are the same as offline.
2. Configuration:
Click the menu in Eclipse:Windows ->
Preferences ->
Go, enter the configuration interface of the Go plug-in, and then perform
Go Dictionary and
GOPATH Fill in the key configuration items (remember to check the last item):
Apply to apply the setting content, and then switch to # The sub-tab of the ##Go
tab is Tools
. Here you need to configure the directories of three tools, namely: gocode
, guru
and godef
:
There are two ways to configure these three items:
Method 1: It is relatively simple. Just click the
Download
button behind the corresponding item to install online. After the download is completed, the corresponding item will be automatically compiled and set. Configuration parameters;Method 2: Download the Go source code of these three items respectively, and then use the
go build
command to compile and obtain the corresponding.exe
file and fill in its directory in the corresponding column.
Installationgocode
:
Here starts with
gocode
is an example. Use method 1. A pop-up window will appear after clicking:
Click OK
to download resources and compile. When you see the following output in Eclipse's Console
window, the configuration is complete:
>> Running: E:\Go\Installs\bin\go.exe get -u github.com/nsf/gocode ^^^ Terminated, exit code: 0 ^^^
and the # of the previously configured Go working directory GOPATH
There will be an additional gocode.exe
file in the ##bin directory.
Installationgodef:
>> Running: E:\Go\Installs\bin\go.exe get -u github.com/rogpeppe/godef ^^^ Terminated, exit code: 0 ^^^
Installationguru:
golang.org/x/tools/cmd/guru, but you cannot access
golang.org without circumventing the wall, and the installation will report an error:
Running: E:\Go\Installs\bin\go.exe get -u golang.org/x/tools/cmd/guru package golang.org/x/tools/cmd/guru: unrecognized import path "golang.org/x/tools/cmd/guru" (https fetch: Get https://golang.org/x/tools/cmd/guru?go-get=1: read tcp 10.0.2.245:15668->216.239.37.1:443: wsarecv: An established connection was aborted by the software in your host machine.) ^^^ Terminated, exit code: 1 ^^^
guru:
- First obtain the source code
- of guru
from Github. Of course, the usual approach is to put the entire
Download the Git project ; Extract the project compressed package, rename it tools - , and then create a new one in the
src
directory of the previously configured Go installation directory Name a foldergolang.org
, create a newx
folder under this folder, and put the decompressed files intogolang.org/x/
Under the folder;Locate the
bin - directory under the
GOPATH
configured directory on the command line and executego build golang.org/x /tools/cmd/guru
, successful execution found that aguru.exe
file was generated in this directory;Configure the
of - Tools
in Eclipse The guru
directory is the path to theguru.exe
file generated above. Click
to save the configuration information. At this point, the configuration operation has been completed:
#1. Create project:
Click in Eclipse:
File
New ->
Project..., select
Go ->
Go Project, enter the project name and click
Finish to complete the project creation:
## 2. Create a test source file:
Create a new folder main in the
scr directory of the project, and then create a new helloworld .go
file, the content is as follows: <div class="code" style="position:relative; padding:0px; margin:0px;"><pre class='brush:php;toolbar:false;'>package mainimport ( "fmt")func main(){
fmt.Println("Hello world!")
}</pre><div class="contentsignin">Copy after login</div></div>
3. Execute the test code:
Selecthelloworld.go,
right click -> Run As
-> Go Application
to execute this script, the output result: <div class="code" style="position:relative; padding:0px; margin:0px;"><pre class='brush:php;toolbar:false;'>Hello world!</pre><div class="contentsignin">Copy after login</div></div>[Related recommendations : <code>Go video tutorial
, Programming teaching
The above is the detailed content of What is GoClipse. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











The problem of using RedisStream to implement message queues in Go language is using Go language and Redis...

What should I do if the custom structure labels in GoLand are not displayed? When using GoLand for Go language development, many developers will encounter custom structure tags...

Which libraries in Go are developed by large companies or well-known open source projects? When programming in Go, developers often encounter some common needs, ...

Go language performs well in building efficient and scalable systems. Its advantages include: 1. High performance: compiled into machine code, fast running speed; 2. Concurrent programming: simplify multitasking through goroutines and channels; 3. Simplicity: concise syntax, reducing learning and maintenance costs; 4. Cross-platform: supports cross-platform compilation, easy deployment.

Resource management in Go programming: Mysql and Redis connect and release in learning how to correctly manage resources, especially with databases and caches...

Efficiently handle concurrency security issues in multi-process log writing. Multiple processes write the same log file at the same time. How to ensure concurrency is safe and efficient? This is a...

Do I need to install an Oracle client when connecting to an Oracle database using Go? When developing in Go, connecting to Oracle databases is a common requirement...

Golang is better than Python in terms of performance and scalability. 1) Golang's compilation-type characteristics and efficient concurrency model make it perform well in high concurrency scenarios. 2) Python, as an interpreted language, executes slowly, but can optimize performance through tools such as Cython.
