当前位置:网站首页>Go language introduction
Go language introduction
2022-07-02 03:53:00 【UPythonFish】
List of articles
Go Language introduction
One Go Language introduction
Go namely Golang, yes Google company 2009 year 11 A programming language officially opened to the public in May .
Go Is a static strongly typed language , It's a compiled language different from an analytic language ( static state : Fixed type Strong type : Direct operation is not allowed for different types ).
Two Go Linguistic characteristics
- Cross platform compiler language ( Can cross compile )
- Grammar is close to C Language
- The Conduit (channel), section (slice), Concurrent (routine)–》 Thread pool + coroutines
- There's a garbage collection mechanism (GC)
- Support object-oriented and process oriented programming patterns
3、 ... and Go Language development
go Language is also used c Written , stay 2009 year 11 month 7 Japan Release weekly.2009-11-06, Early versions , Here are some important go edition
- 2012 year 3 month 28 Japan go1 —— Stable release
- 2015 year 8 month 19 Japan go1.5 —— Architecture changes implemented , At the same time, it retains the compatibility with the old version , Removed... From this update ” The last remnant C Code ”—》 Bootstrap
- 2018 year 8 month 24 Japan go1.11 —— modules Support , Discard go path Package management
- 2020 year 2 month go 1.14— — Now? Go Module Already available for production environments
- so far :1.17.6 Start supporting generics ( Extra operation )
go Language is now used by almost all large and medium-sized companies , And there are many mature open source projects , Such as docker,kubernetes etc. , And suitable for server development , Microservice direction , Blockchain development The first open source blockchain software uses go Written , Automatic operation and maintenance docker,k8s Second opening , Cloud platform and other directions . therefore go It has a good development scenario , And learning is relatively simple .
Four Go Development environment construction
4.1 go Of sdk
Download address :https://golang.google.cn/dl/, Find the corresponding system version , Download the latest version , Just take the next step
After installation , The installation path will be added to the environment variable , stay cmd Window type go version You can output and install go edition

4.2 IDE The choice of
go Of IDE Now the mainstream is goland , vscode, as well as linux Upper vim
Choose here With goland Mainly , Also recommended for beginners goland , although goland charge , But it is powerful and can be cracked ,vscode and vim You need to build your own development environment , And the whole set is no better than goland Small space .
https://www.jetbrains.com/zh-cn/go/download/other.html—》2021.1 edition You can use unlimited trial plug-ins
After downloading, just go to the next step

5、 ... and first go Program
package main // Specify package name , Any one of them go All documents should have this sentence , The package name can be different , Must call now main
import "fmt" // Import the built-in package ,fmt package , Just use fmt package , Will automatically import ,goland Automatically imported , If other editors , Manual import required
func main() {
// Define a function , The function name is main, Must call now main
fmt.Println("hello world") // Real output on the console hello world, You have to use double quotes
}
because go It's a compiler language , and python Dissimilarity , It needs to be compiled before execution
go build go file name // compile go file , win platform Translate it into go file name .exe
go run go File name .exe // Execute the file to run , You can also directly click Run
And it can directly go run go file name // Will automatically compile and run , But the compiled file , Not under the project root path , And it will be deleted after running
Use in development phase goland perform
goland It also provides compiling and running , Good configuration go sdk after Right click to run

In the learning phase , It is recommended to change the configuration , Choose to execute as a file , Otherwise, it is easy to make mistakes .

边栏推荐
- 【人员密度检测】基于形态学处理和GRNN网络的人员密度检测matlab仿真
- leetcode-1380. Lucky number in matrix
- Interface debugging tool simulates post upload file - apipost
- Flutter中深入了解MaterialApp,常用属性解析
- SQL Yiwen get window function
- 高性能 低功耗Cortex-A53核心板 | i.MX8M Mini
- 蓝桥杯单片机省赛第十二届第一场
- go 包的使用
- NLog使用
- The first game of the 12th Blue Bridge Cup single chip microcomputer provincial competition
猜你喜欢

JVM知识点

0 foundation how to learn automated testing? Follow these seven steps step by step and you will succeed

Failed to upgrade schema, error: “file does not exist

Sorted out an ECS summer money saving secret, this time @ old users come and take it away

Cloud service selection of enterprises: comparative analysis of SaaS, PAAS and IAAs

手撕——排序

Oracle的md5

2022-07-01: at the annual meeting of a company, everyone is going to play a game of giving bonuses. There are a total of N employees. Each employee has construction points and trouble points. They nee

Recently, the weather has been extremely hot, so collect the weather data of Beijing, Shanghai, Guangzhou and Shenzhen last year, and make a visual map

蓝桥杯单片机第四届省赛
随机推荐
The first game of the 11th provincial single chip microcomputer competition of the Blue Bridge Cup
Unity脚本的基础语法(8)-协同程序与销毁方法
蓝桥杯单片机省赛第十二届第一场
【DesignMode】建造者模式(Builder model)
滴滴开源DELTA:AI开发者可轻松训练自然语言模型
NLog使用
[Li Kou brush questions] 15 Sum of three numbers (double pointer); 17. Letter combination of phone number (recursive backtracking)
UI (New ui:: MainWindow) troubleshooting
Sorted out an ECS summer money saving secret, this time @ old users come and take it away
Raspberry pie GPIO pin controls traffic light and buzzer
Unity脚本的基础语法(7)-成员变量和实例化
毕设-基于SSM电影院购票系统
[personal notes] PHP common functions - custom functions
Object oriented thinking
【力扣刷题】15.三数之和(双指针);17.电话号码的字母组合(递归回溯)
Go语言介绍
It took me only 3 months to jump out of the comfort zone and become an automated test engineer for 5 years
How should the team choose the feature branch development mode or trunk development mode?
PR zero foundation introductory guide note 2
高性能 低功耗Cortex-A53核心板 | i.MX8M Mini