Table of Contents
Features
Go language purpose
Supported platform
Development tools
Example
Go language environment installation
Home Backend Development Golang Is go language a programming language?

Is go language a programming language?

Nov 28, 2022 pm 06:38 PM
go golang go language

Go language is a programming language. The go language, also known as Golang, is a statically strongly typed, compiled, concurrent programming language with garbage collection capabilities developed by Google. The launch of the Go language aims to reduce the complexity of the code without losing application performance. It has the advantages of "simple deployment, good concurrency, good language design, and good execution performance".

Is go language a programming language?

The operating environment of this tutorial: Windows 7 system, GO version 1.18, Dell G3 computer.

Go (also known as Golang) is a statically strongly typed, compiled, concurrent programming language with garbage collection capabilities developed by Google's Robert Griesemer, Rob Pike and Ken Thompson. The Go language syntax is similar to C, but its functions include: memory safety, GC (garbage collection), structural form and CSP-style concurrent computing.

The Go language (or Golang) originated in 2007 and was officially released in 2009. Go is a very young language, and its main goal is to "have both the development speed of dynamic languages ​​such as Python and the performance and security of compiled languages ​​such as C/C."

Go language is another attempt at programming language design and a major improvement over C-like languages. It not only allows you to access the underlying operating system, but also provides powerful network programming and concurrent programming support. Go language has many uses and can be used for network programming, system programming, concurrent programming, and distributed programming.

The launch of Go language aims to reduce the complexity of the code without losing application performance. It has the advantages of "simple deployment, good concurrency, good language design, and good execution performance". Currently, many domestic IT companies have adopted Go language to develop projects.

Features

Computer software has experienced decades of development and has formed a variety of academic schools, including process-oriented programming, object-oriented programming, functional programming, Regarding message-oriented programming, etc., there are different opinions on which of these ideas is better or worse.

In addition to OOP, some niche programming philosophies have emerged in recent years, and the Go language has also absorbed these ideas. For example, the Go language accepts some ideas from functional programming and supports anonymous functions and closures. For another example, the Go language has accepted the message-oriented programming ideas represented by the Erlang language, supports goroutines and channels, and recommends using messages instead of shared memory for concurrent programming. Overall, the Go language is a very modern language, small but very powerful.

The most important features of Go language:

  • Automatic garbage collection
  • More abundant built-in types
  • Multiple return values ​​for functions
  • Error handling
  • Anonymous functions and closures
  • Types and interfaces
  • Concurrent programming
  • Reflection
  • Language interactivity

Go language purpose

The Go language is designed to be used on giant central servers equipped with Web servers, storage clusters or similar purposes Systems programming language.

For the field of high-performance distributed systems, Go language undoubtedly has higher development efficiency than most other languages. It provides massive parallel support, which is perfect for game server development.

Supported platform

Hardware architecture

Go language design supports mainstream 32-bit and 64-bit x86 platforms. Also supports 32-bit ARM architecture.

Operating system

The Go language supports Windows, Apple Mac OS X, Linux and FreeBSD operating systems on the Go1 version.

Development tools

LiteIDE is a cross-platform lightweight integrated development environment (IDE) specially developed for the Go language, developed by QT write.

Main Features:

  • Supports mainstream operating systems: Windows, Linux, MacOS X.

  • Go compilation environment management and switching: manage and switch multiple Go compilation environments, and support Go language cross-compilation.

  • Project management method consistent with Go standards: GOPATH-based package browser, GOPATH-based compilation system, GOPATH-based Api document retrieval.

  • Go language editing support: class browser and outline display, perfect support for Gocode (code automatic completion tool), Go language document viewing and API quick retrieval, code expression information display F1, source code definition jump supports F2, Gdb breakpoint and debugging support, gofmt automatic formatting support.

  • Other features: Support multi-language interface display, complete plug-in architecture, support editor color scheme, Kate-based grammar display support, full-text word auto-completion, support keyboard shortcuts Binding solution, Markdown document editing support, real-time preview and synchronous display, customized CSS display, export of HTML and PDF documents, batch conversion/merging into HTML/PDF documents

Sublime Text 3 (hereinafter referred to as Sublime) GoSublime gocode MarGo combination.

Its advantages include:

  • Automated prompt code.

  • Automatically format the code when saving, making the code you write more beautiful and in line with Go standards.

  • Support project management

  • Support syntax highlighting

Vim It is a text editor developed from vi and enjoys the title of "God of Editors". It is particularly rich in functions that facilitate programming, such as code completion, compilation, and error jumping, and is widely used among programmers.

Emacs is a text editor developed by the GNU open source organization. It is also an integrated environment. It was once jokingly called "an operating system disguised as an editor."

Eclipse is also a very commonly used development tool. You can use Eclipse to write Go programs.

Goland is an integrated development environment specifically for the Go language. It has now become a paid software.

Example

Next we will write the first Go program hello.go (The extension of the Go language source file is .go) , the code is as follows:

hello.go file

package main
 
import "fmt"
 
func main() {
    fmt.Println("Hello, World!")
}
Copy after login

To execute Go language code, you can use the go run command.

Execute the above code output:

$ go run hello.go 
Hello, World!
Copy after login

In addition, we can also use the go build command to generate binary files:

$ go build hello.go 
$ ls
hello    hello.go
$ ./hello 
Hello, World!
Copy after login

Go language environment installation

Go language supports the following systems:

  • Linux
  • FreeBSD
  • Mac OS X (also known as Darwin)
  • Windows

The installation package download address is: https://golang.org/dl/

If you cannot open it, you can use this address: Downloads - The Go Programming Language.

The package name corresponding to each system:

Operating system Package name
Windows go1.4.windows-amd64.msi
Linux go1.4.linux-amd64.tar.gz
Mac go1.4.darwin-amd64-osx10.8.pkg
FreeBSD go1.4 .freebsd-amd64.tar.gz


##UNIX/Linux/Mac OS X, and FreeBSD installation

The following introduces the source code installation method under UNIX/Linux/Mac OS X, and FreeBSD systems:

1. Download the binary package: go1.4 .linux-amd64.tar.gz.

2. Unzip the downloaded binary package to the /usr/local directory.

tar -C /usr/local -xzf go1.4.linux-amd64.tar.gz
Copy after login
3. Add the /usr/local/go/bin directory to the PATH environment variable:

export PATH=$PATH:/usr/local/go/bin
Copy after login
Copy after login
The above can only temporarily add PATH. Close the terminal and log in again and it will disappear.

We can edit ~/.bash_profile or /etc/profile and add the following command to the end of the file, so that it will take effect permanently:

export PATH=$PATH:/usr/local/go/bin
Copy after login
Copy after login
You need to execute it after adding:

source ~/.bash_profile
或
source /etc/profile
Copy after login

Note: Under MAC system, you can use the installation package ending with .pkg to directly double-click to complete the installation. The installation directory is /usr/local/ go/ Next.


Installation under Windows system

You can use the .msi suffix under Windows (the file can be found in the download list , such as go1.4.2.windows-amd64.msi) installation package to install.

By default the

.msi file will be installed in the c:\Go directory. You can add the c:\Go\bin directory to the Path environment variable. After adding it, you need to restart the command window for it to take effect.

Installation Test

Create working directory

C:\>Go_WorkSpace.

test.go file code:

package main

import "fmt"

func main() {
   fmt.Println("Hello, World!")
}
Copy after login
Use the go command to execute the above code and the output result is as follows:

C:\Go_WorkSpace>go run test.go

Hello, World!
Copy after login
[Related recommendations:

Go video tutorial]

The above is the detailed content of Is go language a programming language?. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
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

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

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What libraries are used for floating point number operations in Go? What libraries are used for floating point number operations in Go? Apr 02, 2025 pm 02:06 PM

The library used for floating-point number operation in Go language introduces how to ensure the accuracy is...

What is the problem with Queue thread in Go's crawler Colly? What is the problem with Queue thread in Go's crawler Colly? Apr 02, 2025 pm 02:09 PM

Queue threading problem in Go crawler Colly explores the problem of using the Colly crawler library in Go language, developers often encounter problems with threads and request queues. �...

How to solve the user_id type conversion problem when using Redis Stream to implement message queues in Go language? How to solve the user_id type conversion problem when using Redis Stream to implement message queues in Go language? Apr 02, 2025 pm 04:54 PM

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

In Go, why does printing strings with Println and string() functions have different effects? In Go, why does printing strings with Println and string() functions have different effects? Apr 02, 2025 pm 02:03 PM

The difference between string printing in Go language: The difference in the effect of using Println and string() functions is in Go...

What should I do if the custom structure labels in GoLand are not displayed? What should I do if the custom structure labels in GoLand are not displayed? Apr 02, 2025 pm 05:09 PM

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

Golang's Purpose: Building Efficient and Scalable Systems Golang's Purpose: Building Efficient and Scalable Systems Apr 09, 2025 pm 05:17 PM

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.

Which libraries in Go are developed by large companies or provided by well-known open source projects? Which libraries in Go are developed by large companies or provided by well-known open source projects? Apr 02, 2025 pm 04:12 PM

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, ...

How to ensure concurrency is safe and efficient when writing multi-process logs? How to ensure concurrency is safe and efficient when writing multi-process logs? Apr 02, 2025 pm 03:51 PM

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

See all articles