当前位置:网站首页>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
边栏推荐
- NAS and San
- 5g NR system architecture
- Shortcut keys for vscode
- 跨页面通讯
- C语言活期储蓄账户管理系统
- The first product of Sepp power battery was officially launched
- AD20 制作 Logo
- 正则表达式
- [dark horse morning post] Luo Yonghao responded to ridicule Oriental selection; Dong Qing's husband Mi Chunlei was executed for more than 700million; Geely officially acquired Meizu; Huawei releases M
- What are the top ten securities companies? Is it safe to open an account online?
猜你喜欢
Solution of ellipsis when pytorch outputs tensor (output tensor completely)
2022年危险化学品生产单位安全生产管理人员特种作业证考试题库模拟考试平台操作
How did automated specification inspection software develop?
【DNS】“Can‘t resolve host“ as non-root user, but works fine as root
【JS】提取字符串中的分数,汇总后算出平均分,并与每个分数比较,输出
5G NR系统架构
WorkManager学习一
风控模型启用前的最后一道工序,80%的童鞋在这都踩坑
Go-3-第一个Go程序
“军备竞赛”时期的对比学习
随机推荐
Singleton mode encapsulates activity management class
中职组网络安全C模块全漏洞脚本讲解包含4个漏洞的脚本
数据类型、
Pseudo class elements -- before and after
2022年流动式起重机司机考试题库及模拟考试
"Everyday Mathematics" serial 58: February 27
Workmanager Learning one
上拉加载原理
Web Components
SAP ui5 objectpagelayout control usage sharing
微信小程序触底加载与下拉刷新的实现
【SWT组件】内容滚动组件 ScrolledComposite
DDOS攻击原理,被ddos攻击的现象
小程序框架Taro
Coneroller执行时候的-26374及-26377错误
脚手架开发基础
Window下线程与线程同步总结
In the year of "mutual entanglement" of mobile phone manufacturers, the "machine sea tactics" failed, and the "slow pace" playing method rose
Learning notes 5 - high precision map solution
Go语言-1-开发环境配置