I'm fairly new to Go and I'm making an a small flashcards app. My package structure is this
VocabHelper
|
-|src
--|com
---|wks
----|card
------Card.go
------Deck.go
----|main
------main.go
Deck and Card are two separate classes but they're in the same package:
Card.go
package card
type Card struct{
Question string
Answer string
}
Deck.go
package card
import (
"math/rand"
)
type Deck struct{
Cards []card.Card
}
When I try to compile the project, the compiler says undefined:card
even though card is in the same package as deck. How can I use the card class in the deck class?