当前位置:网站首页>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
边栏推荐
- Review of last week's hot spots (6.27-7.3)
- 到底什么才是DaaS数据即服务?别再被其他DaaS概念给误导了
- 老掉牙的 synchronized 锁优化,一次给你讲清楚!
- "How to connect the Internet" reading notes - FTTH
- What is inner connection and outer connection? What are the uses and benefits
- HMS core helps baby bus show high-quality children's digital content to global developers
- C语言-入门-基础-语法-[标识符,关键字,分号,空格,注释,输入和输出](三)
- How to batch change file extensions in win10
- Leetcode topic [array] - 121 - the best time to buy and sell stocks
- Global and Chinese markets of thrombography hemostasis analyzer (TEG) 2022-2028: Research Report on technology, participants, trends, market size and share
猜你喜欢
How should PMP learning ideas be realized?
After unplugging the network cable, does the original TCP connection still exist?
AMLOGIC gsensor debugging
C語言-入門-基礎-語法-[運算符,類型轉換](六)
随机事件的关系与运算
LeetCode 74. Search 2D matrix
CLion-控制台输出中文乱码
C language - Introduction - Foundation - syntax - [main function, header file] (II)
Educational Codeforces Round 115 (Rated for Div. 2)
2022-2028 global tensile strain sensor industry research and trend analysis report
随机推荐
Multilingual Wikipedia website source code development part II
Reading notes of how the network is connected - understanding the basic concepts of the network (I)
[error record] no matching function for call to 'cacheflush' cacheflush();)
Reload CUDA and cudnn (for tensorflow and pytorch) [personal sorting summary]
20220701 Barbalat引理证明
What is permission? What is a role? What are users?
Global and Chinese trisodium bicarbonate operation mode and future development forecast report Ⓢ 2022 ~ 2027
Codeforces Round #793 (Div. 2)(A-D)
2022-2028 global elastic strain sensor industry research and trend analysis report
C language - Introduction - Foundation - syntax - [variable, constant light, scope] (V)
Global and Chinese market of air fryer 2022-2028: Research Report on technology, participants, trends, market size and share
Talk about single case mode
[untitled] forwarding least square method
awk从入门到入土(8)数组
C语言-入门-基础-语法-[标识符,关键字,分号,空格,注释,输入和输出](三)
Opencv environment construction (I)
Research Report on the development trend and Prospect of global and Chinese zinc antimonide market Ⓚ 2022 ~ 2027
Simulate EF dbcontext with MOQ - mocking EF dbcontext with MOQ
ArrayBuffer
2022-2028 global special starch industry research and trend analysis report