Debian Codegraph @

errors.go

raw
1 package gitobj
2
3 import "fmt"
4
5 // UnexpectedObjectType is an error type that represents a scenario where an
6 // object was requested of a given type "Wanted", and received as a different
7 // _other_ type, "Wanted".
8 type UnexpectedObjectType struct {
9 // Got was the object type requested.
10 Got ObjectType
11 // Wanted was the object type received.
12 Wanted ObjectType
13 }
14
15 // Error implements the error.Error() function.
16 func (e *UnexpectedObjectType) Error() string {
17 return fmt.Sprintf("gitobj: unexpected object type, got: %q, wanted: %q", e.Got, e.Wanted)
18 }