当前位置:网站首页>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
边栏推荐
- C语言实现QQ聊天室小项目 [完整源码]
- Customize the left sliding button in the line in the applet, which is similar to the QQ and Wx message interface
- 谈谈对Flink框架中容错机制及状态的一致性的理解
- flex4 和 flex3 combox 下拉框长度的解决办法
- Activity enter exit animation
- Workmanager learning 1
- 《通信软件开发与应用》课程结业报告
- 函数///
- Go project practice - Gorm format time field
- GO项目实战 — Gorm格式化时间字段
猜你喜欢
2022年危险化学品生产单位安全生产管理人员特种作业证考试题库模拟考试平台操作
Atcoder beginer contest 254 "e BFS" f st table maintenance differential array GCD "
csdn软件测试入门的测试基本流程
Learning note 4 -- Key Technologies of high-precision map (Part 2)
5g NR system architecture
【Vite】1371- 手把手开发 Vite 插件
How to plan the career of a programmer?
微信核酸检测预约小程序系统毕业设计毕设(7)中期检查报告
DGL中异构图的一些理解以及异构图卷积HeteroGraphConv的用法
Idea create a new sprintboot project
随机推荐
微信核酸检测预约小程序系统毕业设计毕设(8)毕业设计论文模板
Have the bosses ever encountered such problems in the implementation of flinksql by Flink CDC mongdb?
请问postgresql cdc 怎么设置单独的增量模式呀,debezium.snapshot.mo
Workmanager learning 1
Universal double button or single button pop-up
[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
How to plan the career of a programmer?
C语言活期储蓄账户管理系统
九度 1480:最大上升子序列和(动态规划思想求最值)
小程序框架Taro
WorkManager的学习二
Go project practice - Gorm format time field
GO项目实战 — Gorm格式化时间字段
[observation] with the rise of the "independent station" model of cross-border e-commerce, how to seize the next dividend explosion era?
Implementation of wechat applet bottom loading and pull-down refresh
[paper reading] ckan: collaborative knowledge aware autonomous network for adviser systems
PWA (Progressive Web App)
How to write high-quality code?
uniapp
How can non-technical departments participate in Devops?