当前位置:网站首页>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
- 如何编写单元测试用例
- Global and Chinese markets of thrombography hemostasis analyzer (TEG) 2022-2028: Research Report on technology, participants, trends, market size and share
- Educational Codeforces Round 115 (Rated for Div. 2)
- Solve the problem of "Chinese garbled MySQL fields"
- Research Report on the development trend and Prospect of global and Chinese zinc antimonide market Ⓚ 2022 ~ 2027
- Service call feign of "micro service"
- C语言-入门-基础-语法-[运算符,类型转换](六)
- Relationship and operation of random events
- 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 probiotics industry research and trend analysis report
Codeforces Round #793 (Div. 2)(A-D)
Live in a dream, only do things you don't say
Awk from entry to earth (12) awk can also write scripts to replace the shell
C语言-入门-基础-语法-[标识符,关键字,分号,空格,注释,输入和输出](三)
MySQL foundation 02 - installing MySQL in non docker version
C语言-入门-基础-语法-[主函数,头文件](二)
地平线 旭日X3 PI (一)首次开机细节
CLion-控制台输出中文乱码
Jianzhi offer 09 realizes queue with two stacks
随机推荐
Leetcode topic [array] - 121 - the best time to buy and sell stocks
Global and Chinese markets for laser assisted liposuction (LAL) devices 2022-2028: Research Report on technology, participants, trends, market size and share
awk从入土到入门(10)awk内置函数
Awk from entry to earth (8) array
《网络是怎么样连接的》读书笔记 - WEB服务端请求和响应(四)
地平线 旭日X3 PI (一)首次开机细节
Review of last week's hot spots (6.27-7.3)
Awk from entry to earth (15) awk executes external commands
C语言-入门-基础-语法-[主函数,头文件](二)
Horizon sunrise X3 PI (I) first boot details
C language - Introduction - Foundation - syntax - data type (4)
《网络是怎么样连接的》读书笔记 - 认识网络基础概念(一)
2022-2028 global industry research and trend analysis report on anterior segment and fundus OTC detectors
老掉牙的 synchronized 锁优化,一次给你讲清楚!
C語言-入門-基礎-語法-[運算符,類型轉換](六)
2022-2028 global strain gauge pressure sensor industry research and trend analysis report
Launchpad x | mode
After unplugging the network cable, does the original TCP connection still exist?
Global and Chinese PCB function test scale analysis and development prospect planning report Ⓑ 2022 ~ 2027
Awk from digging into the ground to getting started (10) awk built-in functions