Justin
Justin

Reputation: 1249

Unresolved reference of a method call in another method

I want to call two methods(seedAccounts and initializeBucket) from the Seed method. Is there a way to do it? It keeps saying "Unresolved reference".

Here is the code

type BoltClient struct {
    boltDB *bolt.DB
}

func (bc *BoltClient) Seed() {
    initializeBucket() //unresolved reference initializeBucket
    seedAccounts() // unresolved reference seedAccounts
}

func (bc *BoltClient) initializeBucket() {
    //Code
}

func (bc *BoltClient) seedAccounts() {
    //Code
}

Upvotes: 0

Views: 4969

Answers (1)

Elad
Elad

Reputation: 754

initializeBucket() and seedAccounts() are methods of type BoltClient, quick fix:

func (bc *BoltClient) Seed() {
     bc.initializeBucket() 
     bc.seedAccounts()
}

Upvotes: 5

Related Questions