// There is no subclassing in Go. Instead, there is interface and struct embedding. // ReadWriter implementations must satisfy both Reader and Writer type ReadWriter interface { Reader Writer } // Server exposes all the methods that Logger has type Server struct { Host string Port int *log.Logger } // initialize the embedded type the usual way server := &Server{"localhost", 80, log.New(...)} // methods implemented on the embedded struct are passed through server.Log(...) // calls server.Logger.Log(...) // the field name of the embedded type is its type name (in this case Logger) var logger *log.Logger = server.Logger