Go Interfaces

From NovaOrdis Knowledge Base
Revision as of 16:58, 30 March 2016 by Ovidiu (talk | contribs)
Jump to navigation Jump to search

Internal

Overview

Interfaces are not types.

Can only structs be interfaces, or there are other things that can be interfaces?

Declaration

The interface declaration is introduced by the type keyword, to indicated that this is a user-defined type, followed by the type name and the keyword struct.

type MyInterface interface {
     functionName1() return_type
     functionName2() return_type
     ...
}