title: How to call a Go method on a struct type?
body: <p>I getting the error <code>not enough arguments in call to method expression AccountService.Open</code> when I run the following. Run here: <a href="https://play.golang.org/p/Z9y-QIcwNy" rel="nofollow noreferrer">https://play.golang.org/p/Z9y-QIcwNy</a></p>
  
  <pre><code>type AccountService interface {
      Open(no string, name string, openingDate time.Time) AccountService
  }
  
  type Account struct {
      Num      string
      Name     string
      OpenDate time.Time
      Balance  float64
  }
  
  type SavingsAccount struct {
      InterestRate float32
      Account
  }
  
  type CheckingAccount struct {
      TransactionFee float32
      Account
  }
  
  func (a SavingsAccount) Open(no string, name string, openingDate time.Time) AccountService {
      return SavingsAccount{
          Account: Account{Num: no,
              Name:     name,
              OpenDate: openingDate,
          },
          InterestRate: 0.9,
      }
  }
  func (a CheckingAccount) Open(no string, name string, openingDate time.Time) AccountService {
      return CheckingAccount{
          Account: Account{Num: no,
              Name:     name,
              OpenDate: openingDate,
          },
          TransactionFee: 0.15,
      }
  }
  
  func main() {
      aliceAcct := AccountService.Open("12345", "Alice", time.Date(1999, time.January, 03, 0, 0, 0, 0, time.UTC))
  
      fmt.Println("Alice's account =", aliceAcct)
  }
  </code></pre>