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

边栏推荐
- Solution to the length of flex4 and Flex3 combox drop-down box
- SQL Server monitoring statistics blocking script information
- 手机厂商“互卷”之年:“机海战术”失灵,“慢节奏”打法崛起
- Excerpt from "sword comes" (VII)
- 请问postgresql cdc 怎么设置单独的增量模式呀,debezium.snapshot.mo
- In the year of "mutual entanglement" of mobile phone manufacturers, the "machine sea tactics" failed, and the "slow pace" playing method rose
- How to plan the career of a programmer?
- 上拉加载原理
- Nine degrees 1480: maximum ascending subsequence sum (dynamic programming idea for the maximum value)
- [paper reading] ckan: collaborative knowledge aware autonomous network for adviser systems
猜你喜欢

【黑马早报】罗永浩回应调侃东方甄选;董卿丈夫密春雷被执行超7亿;吉利正式收购魅族;华为发布问界M7;豆瓣为周杰伦专辑提前开分道歉...

Who is the "conscience" domestic brand?

【DNS】“Can‘t resolve host“ as non-root user, but works fine as root

How does redis implement multiple zones?

SAP UI5 ObjectPageLayout 控件使用方法分享

小红书自研KV存储架构如何实现万亿量级存储与跨云多活

第五届 Polkadot Hackathon 创业大赛全程回顾,获胜项目揭秘!

Learning note 4 -- Key Technologies of high-precision map (Part 2)

csdn软件测试入门的测试基本流程

What is the most suitable book for programmers to engage in open source?
随机推荐
In wechat applet, after jumping from one page to another, I found that the page scrolled synchronously after returning
流程控制、
[paper reading] ckan: collaborative knowledge aware autonomous network for adviser systems
Go project practice - Gorm format time field
使用bat命令一键启动常用浏览器
风控模型启用前的最后一道工序,80%的童鞋在这都踩坑
数据库中的范式:第一范式,第二范式,第三范式
web安全
谈谈对Flink框架中容错机制及状态的一致性的理解
Secteur non technique, comment participer à devops?
Universal double button or single button pop-up
C function returns multiple value methods
一个可以兼容各种数据库事务的使用范例
Node の MongoDB Driver
Have the bosses ever encountered such problems in the implementation of flinksql by Flink CDC mongdb?
Workmanager Learning one
How do programmers live as they like?
PHP solves the problems of cache avalanche, cache penetration and cache breakdown of redis
How to write high-quality code?
beego跨域问题解决方案-亲试成功