What does Go language belong to?
Go language is a statically compiled language. The go language is a statically strongly typed, compiled, concurrent programming language with garbage collection capabilities developed by Google, and Go is developed based on the Inferno operating system. In the Go language, variables have clear types, and the compiler will also check the correctness of the variable type. The general form of declaring variables is "var name type".
The operating environment of this tutorial: windows10 system, GO 1.18, thinkpad t480 computer.
Go language is a statically compiled language.
Go (also known as Golang) is a statically strongly typed, compiled language developed by Robert Griesemer, Rob Pike and Ken Thompson of Google. The Go language syntax is similar to C, but its functions include: memory safety, GC (garbage collection), structural form and CSP-style concurrent computing.
Go is developed based on the Inferno operating system. Go was officially announced in November 2009, becoming an open source project and implemented on Linux and Mac OS X platforms, and later added implementation under Windows systems. In 2016, Go was selected as "TIOBE's Best Language of 2016" by the software evaluation company TIOBE. Currently, Go releases a second-level version every six months (that is, upgrading from a.x to a.y).
Go's syntax is close to C language, but the declaration of variables is different. Go supports garbage collection. Go's parallel model is based on Tony Hall's Communicating Sequential Process (CSP). Other languages that adopt a similar model include Occam and Limbo, but it also has features of Pi operations, such as channel transmission. Plugin support is opened in version 1.8, which means that some functions can now be dynamically loaded from Go.
Compared with C, Go does not include functions such as enumeration, exception handling, inheritance, generics, assertions, virtual functions, etc., but it adds slice type, concurrency, pipes, garbage collection, Language-level support for features such as interfaces. The Go 2.0 version will support generics, but has a negative attitude towards the existence of assertions, and also defends that it does not provide type inheritance.
Unlike Java, Go has built-in associative arrays (also known as hash tables (Hashes) or dictionaries (Dictionaries)), just like string types.
Declaring variables in Go language
Static language (strongly typed language) is a language in which the data type of the variable can be determined at compile time. Most static languages require the use of variables. The data type must be defined before.
In the Go language, variables (variables) have clear types, and the compiler will also check the correctness of the variable type. In mathematical concepts, a variable represents a number that has no fixed value and can be changed. But from a computer system implementation perspective, a variable is one or more segments of memory used to store data.
The general form of declaring variables:
var name type
Among them, var is the keyword to declare the variable, name is the variable name, and type is the type of the variable.
It should be noted that the Go language is different from many programming languages in that it puts the type of the variable after the name of the variable when declaring the variable. The advantage of this is that it can avoid ambiguous declaration forms like in C language, such as int* a, b;. Only a is a pointer and b is not. If you want both variables to be pointers, you need to write them separately. In Go, they can and easily be declared as pointer types:
var a, b *int
When a variable is declared, the system automatically assigns it a zero value of that type: int is 0, float is 0.0, bool is false, string is empty string, pointer is nil, etc. All memory in Go is initialized.
Recommended learning: Golang tutorial
The above is the detailed content of What does Go language belong to?. 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

AI Hentai Generator
Generate AI Hentai for free.

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 library used for floating-point number operation in Go language introduces how to ensure the accuracy is...

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

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

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

Two ways to define structures in Go language: the difference between var and type keywords. When defining structures, Go language often sees two different ways of writing: First...

When using sql.Open, why doesn’t the DSN report an error? In Go language, sql.Open...
