This is a creation in Article, where the information may have evolved or changed.
Import is followed by the name of the directory, not the name of the package, and if there is a directory under the directory, it must be written in, such as:
" MyPackage " "mypackage/myinnerpackage"
Here to understand the import is followed by the directory name instead of the file name is not the so-called package name, then a directory of the following files can be more than one package? No
" MyPackage " "mypackage/myinnerpackage" "Otherpackage" func Main () { mypackage.myfunc (); Mypackage.myfunc (); Myinnerpackage.myinnerfunc () otherpackages.myotherfunc ()}
There are two directories under the SRC directory, namely MyPackage and Otherpackage
" FMT " func MyFunc () { fmt. Println ("MyFunc");}
" FMT " func MyFunc2 () { fmt. Println ("MyFunc2")}
" FMT " func Myinnerfunc () { fmt. Println ("myinnerpackage")}
" FMT " func Myotherfunc () { fmt. Println ("otherpackages->myotherfunc");}
There's a pervert in the go language. You have to expose the method or attribute name must be capitalized in the first letter.
In Go, the a name is exported if it begins with a capital letter.