18 lines
181 B
Go
18 lines
181 B
Go
package main
|
|
|
|
import "fmt"
|
|
|
|
func main() {
|
|
var err error
|
|
|
|
switch v := err.(type) {
|
|
case fmt.Formatter:
|
|
println("formatter")
|
|
default:
|
|
fmt.Println(v)
|
|
}
|
|
}
|
|
|
|
// Output:
|
|
// <nil>
|