- Security with Go
- John Daniel Leon
- 112字
- 2021-06-30 19:06:49
Packages
Packages are just directories. Every directory is its own package. Creating subdirectories creates a new package. Having no subpackages leads to a flat hierarchy. Subdirectories are used just for organizing code.
Packages should be stored in the src folder of your $GOPATH variable.
A package name should match the folder name or be named main. A main package means that it is not intended to be imported into another application, but meant to compile and run as a program. Packages are imported using the import keyword.
You can import packages individually:
import "fmt"
Alternatively, you can import multiple packages at once by wrapping them with parenthesis:
import (
"fmt"
"log"
)
推薦閱讀
- 走進(jìn)奇妙的數(shù)學(xué)世界(小學(xué)一二年級(jí))
- 這才是好看的數(shù)學(xué)
- 一定要懂博弈論
- 一個(gè)定理的誕生:我與菲爾茨獎(jiǎng)的一千個(gè)日夜
- 粗糙集的論域擴(kuò)展理論及在專家系統(tǒng)中的應(yīng)用
- The Modern C# Challenge
- 數(shù)學(xué)原來(lái)可以這樣學(xué):初中篇
- Blockchain for Decision Makers
- 10堂極簡(jiǎn)概率課
- 愛(ài)情數(shù)學(xué)(TED 思想的力量系列)
- ANSYS Workbench 2020有限元分析從入門到精通(升級(jí)版)
- 代數(shù)的歷史:人類對(duì)未知量的不舍追蹤(修訂版)
- 數(shù)學(xué)建模
- 概率論與數(shù)理統(tǒng)計(jì)
- 說(shuō)不盡的圓周率