mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-09-20 06:46:19 +08:00
deadcode: DebugUnmanagedConfig
This commit is contained in:
parent
2ff585d4c5
commit
4f32ddf132
|
@ -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()
|
||||
// }
|
||||
|
|
Loading…
Reference in a new issue