forked from rosa/hakurei
@@ -6,6 +6,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
"hakurei.app/check"
|
||||
)
|
||||
@@ -78,17 +79,17 @@ type FSImplError struct{ Value FilesystemConfig }
|
||||
|
||||
func (f FSImplError) Error() string {
|
||||
implType := reflect.TypeOf(f.Value)
|
||||
var name string
|
||||
for implType != nil && implType.Kind() == reflect.Ptr {
|
||||
name += "*"
|
||||
var buf strings.Builder
|
||||
for implType != nil && implType.Kind() == reflect.Pointer {
|
||||
buf.WriteByte('*')
|
||||
implType = implType.Elem()
|
||||
}
|
||||
if implType != nil {
|
||||
name += implType.Name()
|
||||
buf.WriteString(implType.Name())
|
||||
} else {
|
||||
name += "nil"
|
||||
buf.WriteString("nil")
|
||||
}
|
||||
return fmt.Sprintf("implementation %s not supported", name)
|
||||
return "implementation " + buf.String() + " not supported"
|
||||
}
|
||||
|
||||
// FilesystemConfigJSON is the [json] adapter for [FilesystemConfig].
|
||||
|
||||
Reference in New Issue
Block a user