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