Imports

This code groups the imports into a parenthesized, "factored" import statement.

You can also write multiple import statements, like:

  1. import "fmt"
  2. import "math"

But it is good style to use the factored import statement.

imports.go

  1. package main
  2. import (
  3. "fmt"
  4. "math"
  5. )
  6. func main() {
  7. fmt.Printf("Now you have %g problems.\n", math.Sqrt(7))
  8. }