使用括号导入多个软件包会产生错误? [关闭]

So for some reason when I import on a single line like this it works fine:

package main

import "fmt"

func main() {
  fmt.Println("hi")
}

But when I do this:

package main

import {
  "fmt"
  "bufio"
  "os"
  "errors"
  "math"
}

func main() {
  fmt.Println("hi")
} 

I get this:

main.go:3:8: expected 'STRING', found '{'

main.go:4:3: expected ';', found "fmt"

Does anyone know what's the problem? Thanks!

When importing multiple packages you should use parenthesis:

package main

import (
  "fmt"
  "bufio"
  "os"
  "errors"
  "math"
)

func main() {
  fmt.Println("hi")
}