Which branch handles the OrderID value?

from Interfaces
Go 1.27 intermediate 2 min

Which branch handles the OrderID value?

Go
package main

import "fmt"

type OrderID string

func (id OrderID) String() string { return string(id) }

func main() {
    var value any = OrderID("A-104")
    switch value.(type) {
    case string:
        fmt.Println("string")
    case fmt.Stringer:
        fmt.Println("stringer")
    default:
        fmt.Println("other")
    }
}
Open in playground
Report an error