-
I'm doing a simple exercise in Go, which is comprised of 2 files:
So far, nothing unseen in other programming languages.
func main(){
variable := deck{"element1", "element2"} // if correctly imported, `deck` is a mnemonic type alias for `[]string`
cards.print()
}
import "fmt"
type deck []string // now 'deck' is a type alias for `[]string`
func (x deck) string {
for i, card := range d { // for index and element ’card’ in all indexes in slice ‘cards’, print index and element
fmt.Println(i, card)
} | However, when hitting # command line arguments
./main.go:8:11: undefined: deck This may happen because My question is: how can the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
you should ask this question in upstream, go-mode |
Beta Was this translation helpful? Give feedback.
I think that did it.
In
spacemacs/layers/+lang/go/funcs.el
, line 147:Changing it to
did the trick.
Thanks for the heads-up!