Compilation Error Happens too Often

package main
import {

func main(){
fmt.Println(“Hello Test”)
E:\GO-Learning\Exercises-Src\src>build test.go

E:\GO-Learning\Exercises-Src\src>go build test.go
can’t load package: package main:
test.go:2:8: expected ‘STRING’, found ‘{’
test.go:3:2: expected ‘;’, found “fmt”

import requires either parenthesis ((, )) with a list of imports or a single import.

It never requires you to write curly braces ({, }).

1 Like