当前位置:网站首页>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
边栏推荐
- 沟通的艺术III:看人之间 之倾听
- Learning II of workmanager
- 2021年山东省赛题库题目抓包
- 【DNS】“Can‘t resolve host“ as non-root user, but works fine as root
- The first product of Sepp power battery was officially launched
- Node の MongoDB Driver
- 2022年T电梯修理操作证考试题及答案
- 一个可以兼容各种数据库事务的使用范例
- Universal double button or single button pop-up
- Node の MongoDB Driver
猜你喜欢
"Everyday Mathematics" serial 58: February 27
Learning note 4 -- Key Technologies of high-precision map (Part 2)
Who is the "conscience" domestic brand?
【js学习笔记五十四】BFC方式
In the year of "mutual entanglement" of mobile phone manufacturers, the "machine sea tactics" failed, and the "slow pace" playing method rose
手机厂商“互卷”之年:“机海战术”失灵,“慢节奏”打法崛起
Secteur non technique, comment participer à devops?
[observation] with the rise of the "independent station" model of cross-border e-commerce, how to seize the next dividend explosion era?
csdn软件测试入门的测试基本流程
AtCoder Beginner Contest 258「ABCDEFG」
随机推荐
变量///
C语言活期储蓄账户管理系统
WorkManager学习一
2022年流动式起重机司机考试题库及模拟考试
vite//
小程序框架Taro
九度 1480:最大上升子序列和(动态规划思想求最值)
In the year of "mutual entanglement" of mobile phone manufacturers, the "machine sea tactics" failed, and the "slow pace" playing method rose
Ad20 make logo
运算符、、
埋点111
Node の MongoDB Driver
What is the most suitable book for programmers to engage in open source?
Taro进阶
2022年化工自动化控制仪表考试试题及在线模拟考试
Go语言-1-开发环境配置
Should the dependency given by the official website be Flink SQL connector MySQL CDC, with dependency added
C function returns multiple value methods
非技术部门,如何参与 DevOps?
Secteur non technique, comment participer à devops?