Skip to content

Add info about embedding interfaces into structs #20

@itaranto

Description

@itaranto

Currently, only struct on struct or interface on interface embedding is explained in OOP.md.

It would be nice to have an explanation about embedding interfaces into structs.

Here's a nice example:
https://github.com/dapr/components-contrib/blob/master/state/store.go#L51

In this example the DefaultBulkStore struct embeds the Store interface, DefaultBulkStore the uses the embedded Store interface to also implement BulkStore.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions