deadcode: DebugUnmanagedConfig

This commit is contained in:
Tom Limoncelli 2024-03-03 11:48:12 -05:00
parent 2ff585d4c5
commit 4f32ddf132

View file

@ -1,9 +1,6 @@
package models
import (
"bytes"
"fmt"
"github.com/gobwas/glob"
)
@ -28,25 +25,26 @@ type UnmanagedConfig struct {
TargetGlob glob.Glob `json:"-"` // Compiled version
}
// DebugUnmanagedConfig returns a string version of an []*UnmanagedConfig for debugging purposes.
func DebugUnmanagedConfig(uc []*UnmanagedConfig) string {
if len(uc) == 0 {
return "UnmanagedConfig{}"
}
// Uncomment to use:
// // DebugUnmanagedConfig returns a string version of an []*UnmanagedConfig for debugging purposes.
// func DebugUnmanagedConfig(uc []*UnmanagedConfig) string {
// if len(uc) == 0 {
// return "UnmanagedConfig{}"
// }
var buf bytes.Buffer
b := &buf
// var buf bytes.Buffer
// b := &buf
fmt.Fprint(b, "UnmanagedConfig{\n")
for i, c := range uc {
fmt.Fprintf(b, "%00d: (%v, %+v, %v)\n",
i,
c.LabelGlob,
c.RTypeMap,
c.TargetGlob,
)
}
fmt.Fprint(b, "}")
// fmt.Fprint(b, "UnmanagedConfig{\n")
// for i, c := range uc {
// fmt.Fprintf(b, "%00d: (%v, %+v, %v)\n",
// i,
// c.LabelGlob,
// c.RTypeMap,
// c.TargetGlob,
// )
// }
// fmt.Fprint(b, "}")
return b.String()
}
// return b.String()
// }