Google News
logo
Golang - Interview Questions
What are packages in a Go program?
Packages (pkg) are directories within your Go workspace that contain Go source files or other packages. Every function, variable, and type from your source files are stored in the linked package. Every Go source file belongs to a package, which is declared at the top of the file using :
package <packagename>
You can import and export packages to reuse exported functions or types using :
import <packagename>
Golang’s standard package is fmt, which contains formatting and printing functionalities like Println().
Advertisement