Go code
import "strings"
fmt.Println(strings.ToUpper("go"))Line-by-line explanation
- Import makes the standard strings package available.
- Strings.ToUpper selects an exported function.
- The result is displayed.
Expected output
GOThis is the expected result.
An external package comes from another module and must be recorded as a dependency. Import only packages the file actually uses; Go rejects unused imports.