diff --git a/go-demo-4/account/vault.go b/go-demo-4/account/vault.go index 8954904..b76de27 100644 --- a/go-demo-4/account/vault.go +++ b/go-demo-4/account/vault.go @@ -8,11 +8,20 @@ import ( "github.com/fatih/color" ) -type Db interface { +type ByteReader interface { Read() ([]byte, error) +} + +type ByteWriter interface { Write([]byte) } +// embedded interface +type Db interface { + ByteReader + ByteWriter +} + type Vault struct { Accounts []Account `json:"accounts"` UpdatedAt time.Time `json:"updatedAt"`