当前位置:网站首页>The difference between underline and dot of golang import package
The difference between underline and dot of golang import package
2022-04-23 19:21:00 【Handsome that handsome】
stay golang When importing packages , We sometimes encounter the need to underline or dot the front of the package , I never understood what it meant , Then a search was carried out :
The package is underlined _: When importing a package , All the documents under the package init Functions are executed , But sometimes we just need to use init Function. I don't want to import the whole package into ( Do not use other functions in the package )
Before the bag is a dot .:
import(.“fmt”)
The meaning of this point operation is that after the package is imported, when you call the function of the package , You can omit the prefix package name , That's what you called earlier fmt.Println(“hello world”) It can be written as Println(“hello world”)
版权声明
本文为[Handsome that handsome]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210557450790.html
边栏推荐
- SQL server requires to query the information of all employees with surname 'Wang'
- SSDB foundation 1
- Translation of audio signal processing and coding: Preface
- MySQL practical skills
- 浅谈c语言指针的强制转换
- Wechat video extraction and receiving file path
- No, some people can't do the National Day avatar applet (you can open the traffic master and earn pocket money)
- Lottery applet, mother no longer have to worry about who does the dishes (assign tasks), so easy
- Zero base to build profit taking away CPS platform official account
- How to uninstall easyton
猜你喜欢
[record] typeerror: this getOptions is not a function
Application of DCT transform
Network protocol: SCTP flow control transmission protocol
Keysight has chosen what equipment to buy for you
2021-2022-2 ACM training team weekly Programming Competition (8) problem solution
The difference between ordinary inner class and static inner class
[report] Microsoft: application of deep learning methods in speech enhancement
[报告] Microsoft :Application of deep learning methods in speech enhancement
深度学习——特征工程小总结
MySQL restores or rolls back data through binlog
随机推荐
Client interns of a large factory share their experience face to face
Parsing headless jsonarray arrays
Tencent cloud GPU best practices - remote development training using jupyter pycharm
SSDB基础3
开关电源设计分享及电源设计技巧图解
JS controls the file type and size when uploading files
MySQL syntax collation (3)
Intuitive understanding of the essence of two-dimensional rotation
@Analysis of conditional on Web Application
Steps to build a deep learning environment GPU
PostgreSQL
Web Security
Common processing of point cloud dataset
SSDB foundation 1
为何PostgreSQL即将超越SQL Server?
坐标转换WGS-84 转 GCJ-02 和 GCJ-02转WGS-84
RuntimeError: Providing a bool or integral fill value without setting the optional `dtype` or `out`
腾讯云GPU最佳实践-使用jupyter pycharm远程开发训练
Modify the font size of hint in editext
Machine learning catalog