func (rm *FilteredResultMap) Load(key string) (*FilteredResult, error) {
	v, ok := rm.sm.Load(key)
	if !ok {
		return nil, fmt.Errorf("fail to get the value of key %q from results", key)
	}
	t, ok := v.(*FilteredResult)
	if !ok {
		return nil, errors.New("stored type in FilteredResultMap is invalid")
	}
	return t, nil
}
Load fetches FilteredResult from FilteredResultMap
package reviewdog
import (
	"errors"
	"fmt"
	"sync"
	"github.com/reviewdog/reviewdog/filter"
	"github.com/reviewdog/reviewdog/proto/rdf"
)
type ResultMap struct {
	sm sync.Map
}
type Result struct {
	Name        string
	Level       string
	Diagnostics []*rdf.Diagnostic
	CmdErr error
}
func (r *Result) CheckUnexpectedFailure() error {
	if r.CmdErr != nil && len(r.Diagnostics) == 0 {
		return fmt.Errorf("%s failed with zero findings: The command itself "+
			"failed (%v) or reviewdog cannot parse the results", r.Name, r.CmdErr)
	}
	return nil
}
func (rm *ResultMap) Store(key string, r *Result) {
	rm.sm.Store(key, r)
}
func (rm *ResultMap) Load(key string) (*Result, error) {
	v, ok := rm.sm.Load(key)
	if !ok {
		return nil, fmt.Errorf("fail to get the value of key %q from results", key)
	}
	t, ok := v.(*Result)
	if !ok {
		return nil, errors.New("stored type in ResultMap is invalid")
	}
	return t, nil
}
func (rm *ResultMap) Range(f func(key string, val *Result)) {
	rm.sm.Range(func(k, v interface{}) bool {
		f(k.(string), v.(*Result))
		return true
	})
}
func (rm *ResultMap) Len() int {
	l := 0
	rm.sm.Range(func(_, _ interface{}) bool {
		l++
		return true
	})
	return l
}
type FilteredResult struct {
	Level              string
	FilteredDiagnostic []*filter.FilteredDiagnostic
}
type FilteredResultMap struct {
	sm sync.Map
}
func (rm *FilteredResultMap) Store(key string, r *FilteredResult) {
	rm.sm.Store(key, r)
}