expected 'IDENT', found 'break'
This is my code: -
package break
import (
"fmt"
)
func BreakGoTest() {
snafu := []interface{}{"First", "Second", "Third"}
fmt.Println(snafu...)
}
Can you see what I did wrong ?
Yep, I've named my package .... break .... which is a reserved word.
Once I changed my package name: -
package breaker
import (
"fmt"
)
// BreakGoTest - This function does stuff
func BreakGoTest() {
snafu := []interface{}{"First", "Second", "Third"}
fmt.Println(snafu...)
}
all is well.
For the record, this code is merely to allow me to test go fmt .....
No comments:
Post a Comment