当前位置:网站首页>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 .
边栏推荐
- 近段时间天气暴热,所以采集北上广深去年天气数据,制作可视化图看下
- The 6th Blue Bridge Cup single chip microcomputer provincial competition
- The first game of the 11th provincial single chip microcomputer competition of the Blue Bridge Cup
- 蓝桥杯单片机数码管技巧
- [untitled]
- The first game of the 12th Blue Bridge Cup single chip microcomputer provincial competition
- [mv-3d] - multi view 3D target detection network
- Raspberry pie GPIO pin controls traffic light and buzzer
- 整理了一份ECS夏日省钱秘籍,这次@老用户快来领走
- Didi open source Delta: AI developers can easily train natural language models
猜你喜欢
[Li Kou brush questions] 15 Sum of three numbers (double pointer); 17. Letter combination of phone number (recursive backtracking)
Learn more about materialapp and common attribute parsing in fluent
【DesignMode】原型模式(prototype pattern)
[ibdfe] matlab simulation of frequency domain equalization based on ibdfe
A thorough understanding of the development of scorecards - the determination of Y (Vintage analysis, rolling rate analysis, etc.)
It took me only 3 months to jump out of the comfort zone and become an automated test engineer for 5 years
Didi open source Delta: AI developers can easily train natural language models
初识string+简单用法(二)
【力扣刷题】15.三数之和(双指针);17.电话号码的字母组合(递归回溯)
Interface debugging tool simulates post upload file - apipost
随机推荐
The 8th Blue Bridge Cup single chip microcomputer provincial competition
【小技巧】使用matlab GUI以对话框模式读取文件
Hands on deep learning (II) -- multi layer perceptron
[personal notes] PHP common functions - custom functions
[mv-3d] - multi view 3D target detection network
蓝桥杯单片机省赛第五届
Go语言介绍
跳出舒适区,5年点工转型自动化测试工程师,我只用了3个月时间
Vite: configure IP access
Jetpack's livedata extension mediatorlivedata
go 语言命名规范
Three ways for programmers to learn PHP easily and put chaos out of order
u本位合约爆仓清算解决方案建议
Unity脚本的基础语法(8)-协同程序与销毁方法
The page in H5 shows hidden execution events
接口调试工具模拟Post上传文件——ApiPost
2022-07-01:某公司年会上,大家要玩一食发奖金游戏,一共有n个员工, 每个员工都有建设积分和捣乱积分, 他们需要排成一队,在队伍最前面的一定是老板,老板也有建设积分和捣乱积分, 排好队后,所有
How about Ping An lifetime cancer insurance?
The first game of the 12th Blue Bridge Cup single chip microcomputer provincial competition
NLog use