🐹 Go (Golang)
Beginner
What is an interface in Go?
Answer
An interface in Go defines a set of method signatures that a type must implement. Unlike Java or C#, Go uses implicit interface satisfaction — a type implements an interface simply by having all the required methods, with no explicit implements keyword. For example, any type with a String() string method implements the built-in fmt.Stringer interface. This design allows loose coupling between packages and enables powerful patterns like dependency injection and mocking in tests without any framework.