Skip to content
Quiz · Errors · lesson 7 of 11

Quiz — == or errors.Is

What does the program print?

GO
package main

import (
    "errors"
    "fmt"
)

func main() {
    errNotFound := errors.New("not found")
    err := fmt.Errorf("load user: %w", errNotFound)
    fmt.Println(err == errNotFound, errors.Is(err, errNotFound))
}

Subscribe to take the course

The course is free. Sign in with Telegram and subscribe to the channel to open every lesson.

Sign in another way