当前位置:网站首页>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

边栏推荐
猜你喜欢
![[vite] 1371 - develop vite plug-ins by hand](/img/7f/84bba39965b4116f20b1cf8211f70a.png)
[vite] 1371 - develop vite plug-ins by hand

2022年流动式起重机司机考试题库及模拟考试
![[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](/img/d7/4671b5a74317a8f87ffd36be2b34e1.jpg)
[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

2022年危险化学品经营单位主要负责人特种作业证考试题库及答案

How do programmers live as they like?

DGL中异构图的一些理解以及异构图卷积HeteroGraphConv的用法

双向RNN与堆叠的双向RNN

非技術部門,如何參與 DevOps?
![[paper reading] kgat: knowledge graph attention network for recommendation](/img/fa/d2061bc7bd437f062d46a009cf32cf.png)
[paper reading] kgat: knowledge graph attention network for recommendation

WorkManager学习一
随机推荐
DDOS攻击原理,被ddos攻击的现象
“军备竞赛”时期的对比学习
【Vite】1371- 手把手开发 Vite 插件
想请教一下,十大券商有哪些?在线开户是安全么?
Universal double button or single button pop-up
Secteur non technique, comment participer à devops?
Error: module not found: error: can't resolve 'xxx' in 'XXXX‘
Go-2-Vim IDE常用功能
Nuxt//
谈谈对Flink框架中容错机制及状态的一致性的理解
Golang应用专题 - channel
Have the bosses ever encountered such problems in the implementation of flinksql by Flink CDC mongdb?
Qt实现json解析
TSQL–标示列、GUID 、序列
Go project practice - parameter binding, type conversion
一个可以兼容各种数据库事务的使用范例
Window下线程与线程同步总结
web安全
DGL中异构图的一些理解以及异构图卷积HeteroGraphConv的用法
双向RNN与堆叠的双向RNN