- 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"
)
推薦閱讀
- Advanced Blockchain Development
- 迷人的邏輯題
- 好玩的數(shù)學(xué)符號(hào)
- 妙趣橫生博弈論:事業(yè)與人生的成功之道(白金版)
- 別說你不懂?dāng)?shù)學(xué)
- 魔方的思維世界
- 救命的數(shù)學(xué)
- 數(shù)學(xué)與決策:數(shù)學(xué)教你做決定
- 科學(xué)的數(shù)學(xué)本質(zhì)
- 硅谷工程師爸爸的超強(qiáng)數(shù)學(xué)思維課:激發(fā)孩子的數(shù)感天賦
- 無言的宇宙
- 博弈論與信息經(jīng)濟(jì)學(xué):PBL教程
- Security with Go
- 說不盡的圓周率
- 高等數(shù)學(xué)習(xí)題全解(上冊(cè))