当前位置:网站首页>Rules for using init in golang
Rules for using init in golang
2022-07-04 09:16:00 【The diligent bird that flies first】
package main
import "fmt"
var age = test()
func test() int{
fmt.Println("test")
return 90
}
func init(){
fmt.Println("init start")
}
func main(){
fmt.Println("main start")
}
The results of the implementation are as follows
test
init start
main start
- Execute global variable
- perform init function , As long as it is used for initialization of global variables
- perform main function
边栏推荐
- awk从入门到入土(6)正则匹配
- Awk from entry to earth (12) awk can also write scripts to replace the shell
- Launpad | 基础知识
- Live in a dream, only do things you don't say
- C language - Introduction - Foundation - syntax - [main function, header file] (II)
- At the age of 30, I changed to Hongmeng with a high salary because I did these three things
- How should PMP learning ideas be realized?
- ArrayBuffer
- 1211 or chicken and rabbit in the same cage
- What is inner connection and outer connection? What are the uses and benefits
猜你喜欢
165 webmaster online toolbox website source code / hare online tool system v2.2.7 Chinese version
GoLand environment variable configuration
C language - Introduction - Foundation - syntax - [variable, constant light, scope] (V)
2022-2028 global visual quality analyzer industry research and trend analysis report
保姆级JDEC增删改查练习
到底什么才是DaaS数据即服务?别再被其他DaaS概念给误导了
C语言-入门-基础-语法-数据类型(四)
Dede plug-in (multi-function integration)
[error record] no matching function for call to 'cacheflush' cacheflush();)
随机事件的关系与运算
随机推荐
Talk about single case mode
Clion console output Chinese garbled code
1211 or chicken and rabbit in the same cage
《网络是怎么样连接的》读书笔记 - WEB服务端请求和响应(四)
Simulate EF dbcontext with MOQ - mocking EF dbcontext with MOQ
CLion-控制台输出中文乱码
C language - Introduction - Foundation - syntax - data type (4)
In depth research and investment strategy report on China's hydraulic parts industry (2022 Edition)
Awk from getting started to digging in (9) circular statement
Ehrlich sieve + Euler sieve + interval sieve
awk从入门到入土(8)数组
Reading notes of how the network is connected - understanding the basic concepts of the network (I)
Global and Chinese markets for laser assisted liposuction (LAL) devices 2022-2028: Research Report on technology, participants, trends, market size and share
2022-2028 global industrial gasket plate heat exchanger industry research and trend analysis report
DR6018-CP01-wifi6-Qualcomm-IPQ6010-IPQ6018-FAMILY-2T2R-2.5G-ETH-port-CP01-802-11AX-MU-MIMO-OFDMA
什么是权限?什么是角色?什么是用户?
Horizon sunrise X3 PI (I) first boot details
Global and Chinese market of wheel hubs 2022-2028: Research Report on technology, participants, trends, market size and share
AI Winter Olympics | is the future coming? Enter the entrance of the meta universe - virtual digital human
什么是uid?什么是Auth?什么是验证器?