search

What is GoClipse

Jan 17, 2023 am 11:23 AM
golanggo languagegoclipse

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.

What is GoClipse

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.

What is GoClipse

#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:

There are two ways to install plug-ins in Eclipse. One is to download the resource package and then install it offline, and the other is to install it directly using Eclipse's online tools.

You can refer to the official guide to complete the installation steps:

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 Local to locate and select the releases directory under the decompression directory of the downloaded resource package, and click Ok:
  • If
  • CDT has been installed, then only select GoClipse. If CDT is not installed, you need to select the first three items: CDT Main Features, CDT Optional Features and GoClipse, and then press Next until the installation is complete.

Online installation:

Click on the menu bar and click

Help -> 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):

After completing the filling, click

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:

Complete the installation of the third item in the same way:

>> Running: E:\Go\Installs\bin\go.exe get -u github.com/rogpeppe/godef
^^^ Terminated, exit code: 0 ^^^

Installationguru:

The second item cannot be installed in this way, because the path for the second item to obtain resources is

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 ^^^

So here we try to use method two to complete Configuration of

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 folder golang.org, create a new x folder under this folder, and put the decompressed files into golang.org/x/ Under the folder; Locate the
  • bin
  • directory under the GOPATH configured directory on the command line and execute go build golang.org/x /tools/cmd/guru, successful execution found that a guru.exe file was generated in this directory; Configure the
  • of
  • Tools in Eclipse The guru directory is the path to the guru.exe file generated above.
  • Click
Apply

to save the configuration information. At this point, the configuration operation has been completed:

Test Project :


#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: <pre class='brush:php;toolbar:false;'>package mainimport ( &quot;fmt&quot;)func main(){ fmt.Println(&quot;Hello world!&quot;) }</pre>3. Execute the test code:

Selecthelloworld.go,

right click

-> Run As -> Go Application to execute this script, the output result: <pre class='brush:php;toolbar:false;'>Hello world!</pre>[Related recommendations : 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!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Learn Go String Manipulation: Working with the 'strings' PackageLearn Go String Manipulation: Working with the 'strings' PackageMay 09, 2025 am 12:07 AM

Go's "strings" package provides rich features to make string operation efficient and simple. 1) Use strings.Contains() to check substrings. 2) strings.Split() can be used to parse data, but it should be used with caution to avoid performance problems. 3) strings.Join() is suitable for formatting strings, but for small datasets, looping = is more efficient. 4) For large strings, it is more efficient to build strings using strings.Builder.

Go: String Manipulation with the Standard 'strings' PackageGo: String Manipulation with the Standard 'strings' PackageMay 09, 2025 am 12:07 AM

Go uses the "strings" package for string operations. 1) Use strings.Join function to splice strings. 2) Use the strings.Contains function to find substrings. 3) Use the strings.Replace function to replace strings. These functions are efficient and easy to use and are suitable for various string processing tasks.

Mastering Byte Slice Manipulation with Go's 'bytes' Package: A Practical GuideMastering Byte Slice Manipulation with Go's 'bytes' Package: A Practical GuideMay 09, 2025 am 12:02 AM

ThebytespackageinGoisessentialforefficientbyteslicemanipulation,offeringfunctionslikeContains,Index,andReplaceforsearchingandmodifyingbinarydata.Itenhancesperformanceandcodereadability,makingitavitaltoolforhandlingbinarydata,networkprotocols,andfileI

Learn Go Binary Encoding/Decoding: Working with the 'encoding/binary' PackageLearn Go Binary Encoding/Decoding: Working with the 'encoding/binary' PackageMay 08, 2025 am 12:13 AM

Go uses the "encoding/binary" package for binary encoding and decoding. 1) This package provides binary.Write and binary.Read functions for writing and reading data. 2) Pay attention to choosing the correct endian (such as BigEndian or LittleEndian). 3) Data alignment and error handling are also key to ensure the correctness and performance of the data.

Go: Byte Slice Manipulation with the Standard 'bytes' PackageGo: Byte Slice Manipulation with the Standard 'bytes' PackageMay 08, 2025 am 12:09 AM

The"bytes"packageinGooffersefficientfunctionsformanipulatingbyteslices.1)Usebytes.Joinforconcatenatingslices,2)bytes.Bufferforincrementalwriting,3)bytes.Indexorbytes.IndexByteforsearching,4)bytes.Readerforreadinginchunks,and5)bytes.SplitNor

Go encoding/binary package: Optimizing performance for binary operationsGo encoding/binary package: Optimizing performance for binary operationsMay 08, 2025 am 12:06 AM

Theencoding/binarypackageinGoiseffectiveforoptimizingbinaryoperationsduetoitssupportforendiannessandefficientdatahandling.Toenhanceperformance:1)Usebinary.NativeEndianfornativeendiannesstoavoidbyteswapping.2)BatchReadandWriteoperationstoreduceI/Oover

Go bytes package: short reference and tipsGo bytes package: short reference and tipsMay 08, 2025 am 12:05 AM

Go's bytes package is mainly used to efficiently process byte slices. 1) Using bytes.Buffer can efficiently perform string splicing to avoid unnecessary memory allocation. 2) The bytes.Equal function is used to quickly compare byte slices. 3) The bytes.Index, bytes.Split and bytes.ReplaceAll functions can be used to search and manipulate byte slices, but performance issues need to be paid attention to.

Go bytes package: practical examples for byte slice manipulationGo bytes package: practical examples for byte slice manipulationMay 08, 2025 am 12:01 AM

The byte package provides a variety of functions to efficiently process byte slices. 1) Use bytes.Contains to check the byte sequence. 2) Use bytes.Split to split byte slices. 3) Replace the byte sequence bytes.Replace. 4) Use bytes.Join to connect multiple byte slices. 5) Use bytes.Buffer to build data. 6) Combined bytes.Map for error processing and data verification.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software