package main
import (
"fmt"
)
func main() {
coba := new(CreditCard)
ProcessPayment(coba,100)
}
type PaymentMethod interface{
Pay(amount float64)
}
type CreditCard struct{}
func (cc CreditCard) Pay(amount float64){
fmt.Println("Pay with CC...")
}
func ProcessPayment(method PaymentMethod, amount float64){
fmt.Println("Processing...")
method.Pay(amount)
}