当前位置:网站首页>Go import self built package
Go import self built package
2022-07-01 02:13:00 【qq_ forty-five million six hundred and ninety-one thousand five】
1.go mod init Yours mudlename
( Execute the command under the project folder )
For example, the package name here is wjj/ginessetial
2. Create your own package , And in main.go Introduction in
Create a new folder , For example, here is DB
DB Created in the go The name of the package is db
So when you are main.go Medium to call DB A function under the folder ( This is Initdb), How to import the corresponding package ?
stay main.go in , It should be written like this when introducing :
import " Yours modulename/ Project root / Function folder "
For example, I want to introduce DB Packages in the directory , That's it :
边栏推荐
- 【JS】【掘金】获取关注了里不在关注者里的人
- (翻译)实时内联验证更容易让用户犯错的原因
- 数学知识:求组合数 III—求组合数
- Short video platform development, relying on drawerlayout to achieve side sliding menu effect
- go导入自建包
- Pytorch —— 基础指北_贰 高中生都能看懂的[反向传播和梯度下降]
- SWT / anr problem - anr/je causes SWT
- The whole process of AS400 API from zero to one
- Template: globally balanced binary tree
- C # generates PPK files in putty format (supports passphrase)
猜你喜欢
随机推荐
Rocketqa: cross batch negatives, de noised hard negative sampling and data augmentation
Static domain and static method
Fast understanding of forward proxy and reverse proxy
(翻译)实时内联验证更容易让用户犯错的原因
十大券商有哪些?另外想问,现在在线开户安全么?
Laravel event & Monitoring
如何学习和阅读代码
org.redisson.client.RedisResponseTimeoutException: Redis server response timeout (3000 ms)错误解决
修复表中的名字(首字符大写,其他小写)
How to add a condition for an associated table in an SQL statement [null value required or not required]
Clickhouse 消除由group by产生的间隙
[Agora] user management
(translation) reasons why real-time inline verification is easier for users to make mistakes
What other hot spots are hidden under 1500W playback? Station B 2 future trends you can't miss
QML control type: tooltip
Alphabet rearrange inator 3000 (dictionary tree custom sorting)
PMP是什麼?
[JS] [Nuggets] get people who are not followers
【毕业季·进击的技术er】--毕业到工作小结
The whole process of AS400 API from zero to one