当前位置:网站首页>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
边栏推荐
- Global and Chinese markets of hemoglobin analyzers in care points 2022-2028: Research Report on technology, participants, trends, market size and share
- LeetCode 74. Search 2D matrix
- How should PMP learning ideas be realized?
- 2022-2028 global small batch batch batch furnace industry research and trend analysis report
- Research Report on research and investment prospects of China's testing machine industry (2022 Edition)
- 上周热点回顾(6.27-7.3)
- awk从入土到入门(10)awk内置函数
- Dynamic analysis and development prospect prediction report of high purity manganese dioxide in the world and China Ⓡ 2022 ~ 2027
- Simulate EF dbcontext with MOQ - mocking EF dbcontext with MOQ
- At the age of 30, I changed to Hongmeng with a high salary because I did these three things
猜你喜欢
Educational Codeforces Round 115 (Rated for Div. 2)
Dede plug-in (multi-function integration)
Some points needing attention in PMP learning
MySQL foundation 02 - installing MySQL in non docker version
2022-2028 global small batch batch batch furnace industry research and trend analysis report
Jianzhi offer 09 realizes queue with two stacks
Solve the problem of "Chinese garbled MySQL fields"
HMS core helps baby bus show high-quality children's digital content to global developers
Industry depression has the advantages of industry depression
[untitled] forwarding least square method
随机推荐
Global and Chinese market of wheel hubs 2022-2028: Research Report on technology, participants, trends, market size and share
2022-2028 global gasket plate heat exchanger industry research and trend analysis report
《网络是怎么样连接的》读书笔记 - WEB服务端请求和响应(四)
2022-2028 global industrial gasket plate heat exchanger industry research and trend analysis report
A subclass must use the super keyword to call the methods of its parent class
C语言-入门-基础-语法-数据类型(四)
Awk from entry to earth (15) awk executes external commands
Awk from entry to earth (7) conditional statements
Live in a dream, only do things you don't say
awk从入门到入土(8)数组
Investment analysis and future production and marketing demand forecast report of China's paper industry Ⓥ 2022 ~ 2028
How to batch change file extensions in win10
You can see the employment prospects of PMP project management
awk从入门到入土(11)awk getline函数详解
In depth research and investment strategy report on China's hydraulic parts industry (2022 Edition)
Flutter 小技巧之 ListView 和 PageView 的各种花式嵌套
Codeforces Round #750 (Div. 2)(A,B,C,D,F1)
C language - Introduction - Foundation - syntax - data type (4)
C语言-入门-基础-语法-[变量,常亮,作用域](五)
LinkedList in the list set is stored in order