当前位置:网站首页>Go-3-the first go program
Go-3-the first go program
2022-07-05 10:42:00 【hahyyy】
first Go Program ( stay Linux Under the system )
Create a new file ~/code/example.go
// Declare the package where the file is located , If it is the main program, it is main
// Go Language uses packages to organize code
// Generally, a folder is a package
// The type or method can be exposed in the package for use by other packages
package main
// Import library
// fmt yes Go A standard library of languages / package
// Used to process standard input and output
import "fmt"
// main Function is the entry to the whole program ,main The package name of the function must also be `main`
// The main package must contain a main function
func main() {
// call fmt Bag Println Method , Output information on the screen
fmt.Println("Hello World!")
}
// A line represents the end of a statement , Multiple statements are written on the same line , Must be used ; Artificial differentiation
// Single-line comments ://
// Multiline comment :/* --- */
// identifier : Same as python Identifier rule
Run code
- Direct operation
- Compile and then execute
Go Language configuration
Configure the installation source
边栏推荐
- WorkManager的学习二
- 中职组网络安全C模块全漏洞脚本讲解包含4个漏洞的脚本
- [paper reading] kgat: knowledge graph attention network for recommendation
- Idea create a new sprintboot project
- Solution of ellipsis when pytorch outputs tensor (output tensor completely)
- 使用bat命令一键启动常用浏览器
- In the year of "mutual entanglement" of mobile phone manufacturers, the "machine sea tactics" failed, and the "slow pace" playing method rose
- 数组、、、
- Golang应用专题 - channel
- LDAP overview
猜你喜欢
【黑马早报】罗永浩回应调侃东方甄选;董卿丈夫密春雷被执行超7亿;吉利正式收购魅族;华为发布问界M7;豆瓣为周杰伦专辑提前开分道歉...
Redis如何实现多可用区?
2022鹏城杯web
基于昇腾AI丨爱笔智能推出银行网点数字化解决方案,实现从总部到网点的信息数字化全覆盖
2022年T电梯修理操作证考试题及答案
重磅:国产IDE发布,由阿里研发,完全开源!
How can non-technical departments participate in Devops?
Idea create a new sprintboot project
LSTM应用于MNIST数据集分类(与CNN做对比)
【js学习笔记五十四】BFC方式
随机推荐
The first product of Sepp power battery was officially launched
微信小程序触底加载与下拉刷新的实现
flink cdc不能监听mysql日志,大家遇到过这个问题吧?
非技術部門,如何參與 DevOps?
[observation] with the rise of the "independent station" model of cross-border e-commerce, how to seize the next dividend explosion era?
Idea create a new sprintboot project
SLAM 01.人类识别环境&路径的模型建立
uniapp
Error: module not found: error: can't resolve 'xxx' in 'XXXX‘
请问大佬们 有遇到过flink cdc mongdb 执行flinksql 遇到这样的问题的么?
SAP ui5 objectpagelayout control usage sharing
2022年危险化学品生产单位安全生产管理人员特种作业证考试题库模拟考试平台操作
pytorch输出tensor张量时有省略号的解决方案(将tensor完整输出)
DOM//
[paper reading] kgat: knowledge graph attention network for recommendation
LSTM应用于MNIST数据集分类(与CNN做对比)
2022年危险化学品经营单位主要负责人特种作业证考试题库及答案
埋点111
使用bat命令一键启动常用浏览器
C language QQ chat room small project [complete source code]