- Security with Go
- John Daniel Leon
- 160字
- 2021-06-30 19:06:42
Creating your first package
Within the ~/src directory, any directory you create is a package. The name of your directory becomes the name of the package or application. We need to first make sure that the src directory exists. Tilde (~) is a shortcut for your home directory similar to the $HOME variable. Refer to the following code block:
mkdir ~/src
Let's create a new package named hello for our first application:
cd ~/src
mkdir hello
A package is simply a directory. You can have one or more source files inside a package. Any subdirectories are treated as separate packages. A package can be an application with a main() function (package main), or it can be a library that can only be imported to other packages. This package doesn't have any files yet, but we'll write the first file in a moment. Don't worry too much about package structure for now. You can read more about package paths at https://golang.org/doc/code.html#PackagePaths.
- 432級(jí)臺(tái)階之第2級(jí)臺(tái)階
- 線性代數(shù)選講
- 數(shù)學(xué)不簡(jiǎn)單:從《最強(qiáng)大腦》發(fā)現(xiàn)思維樂趣
- 數(shù)學(xué)女孩2:費(fèi)馬大定理
- 有限自動(dòng)機(jī)理論
- 一定要懂博弈論
- Origin 9.0科技繪圖與數(shù)據(jù)分析超級(jí)學(xué)習(xí)手冊(cè)
- 數(shù)學(xué)教學(xué)論
- 數(shù)理邏輯
- 數(shù)獨(dú)游戲全集
- 數(shù)學(xué)的故事
- 數(shù)學(xué)多大點(diǎn)事兒
- 說(shuō)不盡的圓周率
- 計(jì)算進(jìn)化史:改變數(shù)學(xué)的命運(yùn)
- 牛津通識(shí)讀本:數(shù)學(xué)(中文版)