You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: context_slog.go
    path of file: ./repos/gotosocial/vendor/github.com/go-logr/logr
    
    the code of the file until where you have to start completion: //go:build go1.21
// +build go1.21

/*
Copyright 2019 The logr Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you
    
func FromContext(ctx context.Context) (Logger, error) {
	v := ctx.Value(contextKey{})
	if v == nil {
		return Logger{}, notFoundError{}
	}

	switch v := v.(type) {
	case Logger:
		return v, nil
	case *slog.Logger:
		return FromSlogHandler(v.Handler()), nil
	default:
		// Not reached.
		panic(fmt.Sprintf("unexpected value type for logr context key: %T", v))
	}
}