what is it?

defines and describes the exact methods some other type must have

uses

reduce boilerplate code

testing

application architecture

empty interface

describes no methods, allows objects of any type

package main
 
import "fmt"
 
func main() {
    person := make(map[string]interface{}, 0)
 
    person["name"] = "Alice"
    person["age"] = 21
    person["height"] = 167.64
 
    fmt.Printf("%+v", person)
}

should not use it often. it’s useful in situations where you need to accept and work with unpredictable or user-defined types

alias: any is syntactic sugar ffor interface{}

golang standard libray interfaces

selected list