| 1 | /* |
| 2 | Copyright 2021 The Kubernetes Authors. |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package dumpscip-go gomod k8s.io/utils . `k8s.io/utils/dump`/ |
| 18 | |
| 19 | import ( |
| 20 | "github.com/davecgh/go-spew/spewscip-go gomod github.com/davecgh/go-spew v1.1.1 `github.com/davecgh/go-spew/spew`/" |
| 21 | ) |
| 22 | |
| 23 | var prettyPrintConfigscip-go gomod k8s.io/utils . `k8s.io/utils/dump`/prettyPrintConfig. = &spewscip-go gomod github.com/davecgh/go-spew v1.1.1 `github.com/davecgh/go-spew/spew`/.ConfigStatescip-go gomod github.com/davecgh/go-spew v1.1.1 `github.com/davecgh/go-spew/spew`/ConfigState#{ |
| 24 | Indentscip-go gomod github.com/davecgh/go-spew v1.1.1 `github.com/davecgh/go-spew/spew`/ConfigState#Indent.: " ", |
| 25 | DisableMethodsscip-go gomod github.com/davecgh/go-spew v1.1.1 `github.com/davecgh/go-spew/spew`/ConfigState#DisableMethods.: true, |
| 26 | DisablePointerAddressesscip-go gomod github.com/davecgh/go-spew v1.1.1 `github.com/davecgh/go-spew/spew`/ConfigState#DisablePointerAddresses.: true, |
| 27 | DisableCapacitiesscip-go gomod github.com/davecgh/go-spew v1.1.1 `github.com/davecgh/go-spew/spew`/ConfigState#DisableCapacities.: true, |
| 28 | } |
| 29 | |
| 30 | // The config MUST NOT be changed because that could change the result of a hash operation |
| 31 | var prettyPrintConfigForHashscip-go gomod k8s.io/utils . `k8s.io/utils/dump`/prettyPrintConfigForHash. = &spewscip-go gomod github.com/davecgh/go-spew v1.1.1 `github.com/davecgh/go-spew/spew`/.ConfigStatescip-go gomod github.com/davecgh/go-spew v1.1.1 `github.com/davecgh/go-spew/spew`/ConfigState#{ |
| 32 | Indentscip-go gomod github.com/davecgh/go-spew v1.1.1 `github.com/davecgh/go-spew/spew`/ConfigState#Indent.: " ", |
| 33 | SortKeysscip-go gomod github.com/davecgh/go-spew v1.1.1 `github.com/davecgh/go-spew/spew`/ConfigState#SortKeys.: true, |
| 34 | DisableMethodsscip-go gomod github.com/davecgh/go-spew v1.1.1 `github.com/davecgh/go-spew/spew`/ConfigState#DisableMethods.: true, |
| 35 | SpewKeysscip-go gomod github.com/davecgh/go-spew v1.1.1 `github.com/davecgh/go-spew/spew`/ConfigState#SpewKeys.: true, |
| 36 | DisablePointerAddressesscip-go gomod github.com/davecgh/go-spew v1.1.1 `github.com/davecgh/go-spew/spew`/ConfigState#DisablePointerAddresses.: true, |
| 37 | DisableCapacitiesscip-go gomod github.com/davecgh/go-spew v1.1.1 `github.com/davecgh/go-spew/spew`/ConfigState#DisableCapacities.: true, |
| 38 | } |
| 39 | |
| 40 | // Pretty wrap the spew.Sdump with Indent, and disabled methods like error() and String() |
| 41 | // The output may change over time, so for guaranteed output please take more direct control |
| 42 | func Prettyscip-go gomod k8s.io/utils . `k8s.io/utils/dump`/Pretty().(a interface{}) string { |
| 43 | return prettyPrintConfigscip-go gomod k8s.io/utils . `k8s.io/utils/dump`/prettyPrintConfig..Sdumpscip-go gomod github.com/davecgh/go-spew v1.1.1 `github.com/davecgh/go-spew/spew`/ConfigState#Sdump().(a) |
| 44 | } |
| 45 | |
| 46 | // ForHash keeps the original Spew.Sprintf format to ensure the same checksum |
| 47 | func ForHashscip-go gomod k8s.io/utils . `k8s.io/utils/dump`/ForHash().(a interface{}) string { |
| 48 | return prettyPrintConfigForHashscip-go gomod k8s.io/utils . `k8s.io/utils/dump`/prettyPrintConfigForHash..Sprintfscip-go gomod github.com/davecgh/go-spew v1.1.1 `github.com/davecgh/go-spew/spew`/ConfigState#Sprintf().("%#v", a) |
| 49 | } |
| 50 | |
| 51 | // OneLine outputs the object in one line |
| 52 | func OneLinescip-go gomod k8s.io/utils . `k8s.io/utils/dump`/OneLine().(a interface{}) string { |
| 53 | return prettyPrintConfigscip-go gomod k8s.io/utils . `k8s.io/utils/dump`/prettyPrintConfig..Sprintfscip-go gomod github.com/davecgh/go-spew v1.1.1 `github.com/davecgh/go-spew/spew`/ConfigState#Sprintf().("%#v", a) |
| 54 | } |