diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-06-08 14:19:11 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-06-08 14:58:24 +0900 |
| commit | f869ff95a12756de97827b4afd93763f9661f144 (patch) | |
| tree | 6f5445ae623f44ceb99c8f7ddb5bb4cd1fb04aa0 /hst/fs.go | |
| parent | 725f2e0ef3eaba1ad46b597604a684125ab93911 (diff) | |
all: apply modernisers
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'hst/fs.go')
| -rw-r--r-- | hst/fs.go | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -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]. |
