The go language is a statically strongly typed, compiled, concurrent programming language developed by Google and has garbage collection capabilities. Go is a procedural programming language that can be used for fast machine code compilation; it provides concurrency mechanisms to easily develop multi-core and networked machine-level programs; it provides support for interfaces and type embedding.
The operating environment of this tutorial: Windows 7 system, GO version 1.18, Dell G3 computer.
What is the go language?
Go (also known as Golang) is a statically strongly typed, compiled, and concurrent type developed by Google. , and a programming language with garbage collection capabilities.
Go is a procedural programming language that can be used for fast machine code compilation. It is a statically typed compiled language. It provides a concurrency mechanism that makes it easy to develop multi-core and networked machine-level programs. It is a fast, dynamically typed and interpreted language; it provides support for interfaces and type embedding.
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.
The Go language is sometimes described as a "C-like language", or "the C language of the 21st century". Go inherits similar expression syntax, control flow structure, basic data types, call parameter value transfer, pointers and many other ideas from C language. It also has the running efficiency of compiled machine code that C language has always valued and is consistent with existing Seamless adaptation to the operating system.
Because the Go language does not have the concepts of classes and inheritance, it does not look the same as Java or C. But it achieves polymorphism through the concept of interface. The Go language has a clear and easy-to-understand lightweight type system, and there is no hierarchy between types. Therefore, it can be said that Go language is a hybrid language.
In addition, many important open source projects are developed using the Go language, including Docker, Go-Ethereum, Thrraform and Kubernetes.
What are the advantages of go language
#It can be directly compiled into machine code without relying on other libraries. The version of glibc has certain requirements. Deployment is Just throw a file in and you're done.
A statically typed language, but it has the feeling of a dynamic language. A statically typed language can detect most of the hidden problems during compilation. The feeling of a dynamic language is that it has many packages. It can be used and is very efficient to write.
The language level supports concurrency. This is the biggest feature of Go. It is born to support concurrency. I once said that there is a difference between natural genes and plastic surgery. We are all equally beautiful. But do you prefer plastic surgery or natural genetic beauty? Go supports concurrency in its genes. It can make full use of multiple cores and make it easy to use concurrency.
Built-in runtime supports garbage collection. This is one of the characteristics of dynamic languages. Although GC is not perfect at present, it is enough to cope with most situations we can encounter. , especially the GC after Go1.1.
It is simple and easy to learn. The authors of Go language all have C genes, so Go naturally has C genes. Then Go keywords are 25, but the expression ability is very powerful, almost Supports most of the features you've seen in other languages: inheritance, overloading, objects, etc.
Rich standard library, Go currently has a large number of built-in libraries, especially the network library is very powerful, and this is my favorite part.
Built-in powerful tools. There are many tool chains built into the Go language. The best one should be the gofmt tool, which automatically formats the code and makes team review so simple. Code The format is exactly the same, so it’s difficult to think of something different.
Cross-platform compilation. If the Go code you write does not contain cgo, then you can compile Linux applications on the window system. How to do it? Go references the code of plan9, which is information that does not depend on the system.
Embedded C support. As mentioned earlier, the author is the author of C, so Go can also directly include C code and make use of the existing rich C library.
What is Go suitable for?
1. Server programming. If you used C or C in the past, Go is suitable for those things, such as log processing, data packaging, virtual machine processing, file systems, etc.
2. Distributed systems, database agents, middleware, etc., such as Etcd.
3. Network programming, this area is currently the most widely used, including Web applications, API applications, download applications, and Go's built-in net/http package basically implements all the network functions we usually use.
4. Database operation
5. Cloud platform. Currently, many foreign cloud platforms are developed using Go. Part of CloudFoundy was formed, and the former VMare technical director came out to develop the apcera cloud platform.
6. Development of game server.
Go language success story
Nsq: Nsq is a high-performance, high-availability message queue system developed by the Go language, with very high performance. Can handle billions of messages every day;
Docker: a virtual packaging tool based on lxc, which can realize the establishment of PAAS platform.
Packer: Used to generate image files for different platforms, such as VM, vbox, AWS, etc. The author is the author of vagrant
Skynet: Distributed scheduling framework
Doozer: distributed synchronization tool, similar to ZooKeeper
Heka: mazila open source log processing system
Cbfs: couchbase open source distributed file system
Tsuru: open source PAAS platform, which has exactly the same functions as SAE
-
Groupcache: A caching system for Google download system written by the author of memcahe
God: A caching system similar to redis, but supports distribution and scalability
Gor: Network traffic packet capture and replay tool
Go language, as a large-scale project development language, has been used by many large companies, and even completely turned to Go development , representatives include Google, Facebook, Tencent, Baidu, Alibaba, JD.com, Xiaomi, 360, Meituan, Didi and Sina, etc. Therefore, the development prospects of Go language are still very good!
Recommended learning: Golang tutorial
The above is the detailed content of What programming language is go language?. For more information, please follow other related articles on the PHP Chinese website!

go语言有缩进。在go语言中,缩进直接使用gofmt工具格式化即可(gofmt使用tab进行缩进);gofmt工具会以标准样式的缩进和垂直对齐方式对源代码进行格式化,甚至必要情况下注释也会重新格式化。

go语言叫go的原因:想表达这门语言的运行速度、开发速度、学习速度(develop)都像gopher一样快。gopher是一种生活在加拿大的小动物,go的吉祥物就是这个小动物,它的中文名叫做囊地鼠,它们最大的特点就是挖洞速度特别快,当然可能不止是挖洞啦。

本篇文章带大家了解一下golang 的几种常用的基本数据类型,如整型,浮点型,字符,字符串,布尔型等,并介绍了一些常用的类型转换操作。

是,TiDB采用go语言编写。TiDB是一个分布式NewSQL数据库;它支持水平弹性扩展、ACID事务、标准SQL、MySQL语法和MySQL协议,具有数据强一致的高可用特性。TiDB架构中的PD储存了集群的元信息,如key在哪个TiKV节点;PD还负责集群的负载均衡以及数据分片等。PD通过内嵌etcd来支持数据分布和容错;PD采用go语言编写。

在写 Go 的过程中经常对比这两种语言的特性,踩了不少坑,也发现了不少有意思的地方,下面本篇就来聊聊 Go 自带的 HttpClient 的超时机制,希望对大家有所帮助。

go语言需要编译。Go语言是编译型的静态语言,是一门需要编译才能运行的编程语言,也就说Go语言程序在运行之前需要通过编译器生成二进制机器码(二进制的可执行文件),随后二进制文件才能在目标机器上运行。

删除map元素的两种方法:1、使用delete()函数从map中删除指定键值对,语法“delete(map, 键名)”;2、重新创建一个新的map对象,可以清空map中的所有元素,语法“var mapname map[keytype]valuetype”。


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

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

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

SublimeText3 English version
Recommended: Win version, supports code prompts!

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft
