Home > Article > Backend Development > How to import packages in golang
Golang uses the syntax element of package to organize source code. All syntax visibility is defined at the package level. Compared with languages such as Java and python, this is not a big deal. What an innovation, but compared with C's traditional include, it appears to be much more "advanced".
The definition and use of packages in Golang seems very simple:
Define packages through the package keyword:
package xxx
Use the import keyword to import the standard library package to be used or third-party dependency packages.
import "a/b/c" import "fmt" c.Func1() fmt.Println("Hello, World")
For more golang knowledge, please pay attention to the golang tutorial column.
The above is the detailed content of How to import packages in golang. For more information, please follow other related articles on the PHP Chinese website!